mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
consolidate retry logic in error interceptor
remove retry operator from services
This commit is contained in:
parent
9918cb4ffc
commit
89c53c508b
@ -1,9 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { apiURL, apiRetry } from '../api-utils';
|
||||
import { apiURL } from '../api-utils';
|
||||
import { Completion } from '../completion';
|
||||
import { retry, map } from 'rxjs/operators';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs';
|
||||
import { StType } from '../type';
|
||||
|
||||
@ -35,7 +35,6 @@ export class DbCompletionService {
|
||||
return this.http
|
||||
.get<Completion>(this.dbStatusUrl, httpOptions)
|
||||
.pipe(
|
||||
retry(apiRetry),
|
||||
map(res => {
|
||||
// Remove from array in developement
|
||||
// in-memory-web-api returns arrays
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { CookieService } from './cookie.service';
|
||||
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { map, retry, catchError } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { environment } from '../../environments/environment'
|
||||
import { apiURL, apiRetry } from '../api-utils'
|
||||
import { apiURL } from '../api-utils'
|
||||
import Folder from '../folder'
|
||||
|
||||
@Injectable({
|
||||
@ -28,7 +27,6 @@ export class DbStatusService {
|
||||
return this.http
|
||||
.get<Folder.Status>(this.dbStatusUrl, httpOptions)
|
||||
.pipe(
|
||||
retry(apiRetry),
|
||||
map(res => {
|
||||
// Remove from array in developement
|
||||
// in-memory-web-api returns arrays
|
||||
|
@ -2,12 +2,12 @@ import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { map, retry } from 'rxjs/operators';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import Folder from '../folder';
|
||||
import Device from '../device';
|
||||
import { environment } from '../../environments/environment'
|
||||
import { apiURL, apiRetry } from '../api-utils'
|
||||
import { apiURL } from '../api-utils'
|
||||
import { ProgressService } from './progress.service';
|
||||
|
||||
@Injectable({
|
||||
@ -32,7 +32,6 @@ export class SystemConfigService {
|
||||
return this.http
|
||||
.get(this.systemConfigUrl)
|
||||
.pipe(
|
||||
retry(apiRetry),
|
||||
map(res => {
|
||||
this.folders = res['folders'];
|
||||
this.devices = res['devices'];
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { apiURL, apiRetry } from '../api-utils';
|
||||
import { apiURL } from '../api-utils';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { retry, map } from 'rxjs/operators';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs';
|
||||
import { SystemConnections } from '../connections';
|
||||
|
||||
@ -18,7 +18,6 @@ export class SystemConnectionsService {
|
||||
return this.http
|
||||
.get<SystemConnections>(this.systemConfigUrl)
|
||||
.pipe(
|
||||
retry(apiRetry),
|
||||
map(res => {
|
||||
return res;
|
||||
})
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { apiURL, apiRetry } from '../api-utils';
|
||||
import { apiURL } from '../api-utils';
|
||||
import { Observable } from 'rxjs';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { retry, map } from 'rxjs/operators';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { SystemStatus } from '../system-status';
|
||||
|
||||
@Injectable({
|
||||
@ -19,7 +19,6 @@ export class SystemStatusService {
|
||||
return this.http
|
||||
.get<SystemStatus>(this.systemStatusUrl)
|
||||
.pipe(
|
||||
retry(apiRetry),
|
||||
map(res => {
|
||||
return res;
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user