mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-29 13:22:42 +00:00
add system config service retry
This commit is contained in:
parent
241864b43c
commit
90c39de0cc
@ -2,13 +2,13 @@ import { Injectable } from '@angular/core';
|
|||||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable, Subject } from 'rxjs';
|
import { Observable, Subject } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map, retry } from 'rxjs/operators';
|
||||||
|
|
||||||
import { Folder } from './folder';
|
import { Folder } from './folder';
|
||||||
import { Device } from './device';
|
import { Device } from './device';
|
||||||
import { CookieService } from './cookie.service';
|
import { CookieService } from './cookie.service';
|
||||||
import { environment } from '../environments/environment'
|
import { environment } from '../environments/environment'
|
||||||
import { apiURL } from './api-utils'
|
import { apiURL, apiRetry } from './api-utils'
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@ -31,14 +31,16 @@ export class SystemConfigService {
|
|||||||
getSystemConfig(): Observable<any> {
|
getSystemConfig(): Observable<any> {
|
||||||
return this.http
|
return this.http
|
||||||
.get(this.systemConfigUrl, this.httpOptions)
|
.get(this.systemConfigUrl, this.httpOptions)
|
||||||
.pipe(map(res => {
|
.pipe(
|
||||||
this.folders = res['folders'];
|
retry(apiRetry),
|
||||||
this.devices = res['devices'];
|
map(res => {
|
||||||
this.foldersSubject.next(this.folders);
|
this.folders = res['folders'];
|
||||||
this.devicesSubject.next(this.devices);
|
this.devices = res['devices'];
|
||||||
|
this.foldersSubject.next(this.folders);
|
||||||
|
this.devicesSubject.next(this.devices);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user