From 89c53c508bff9aaa5b0d19a3b100845eee30393a Mon Sep 17 00:00:00 2001 From: Jesse Lucas Date: Wed, 8 Apr 2020 10:07:13 -0400 Subject: [PATCH] consolidate retry logic in error interceptor remove retry operator from services --- src/app/services/db-completion.service.ts | 5 ++--- src/app/services/db-status.service.ts | 8 +++----- src/app/services/system-config.service.ts | 5 ++--- src/app/services/system-connections.service.ts | 5 ++--- src/app/services/system-status.service.ts | 5 ++--- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/app/services/db-completion.service.ts b/src/app/services/db-completion.service.ts index 174481308..d7d5ce668 100644 --- a/src/app/services/db-completion.service.ts +++ b/src/app/services/db-completion.service.ts @@ -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(this.dbStatusUrl, httpOptions) .pipe( - retry(apiRetry), map(res => { // Remove from array in developement // in-memory-web-api returns arrays diff --git a/src/app/services/db-status.service.ts b/src/app/services/db-status.service.ts index dd2ff2665..6c51581c7 100644 --- a/src/app/services/db-status.service.ts +++ b/src/app/services/db-status.service.ts @@ -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(this.dbStatusUrl, httpOptions) .pipe( - retry(apiRetry), map(res => { // Remove from array in developement // in-memory-web-api returns arrays diff --git a/src/app/services/system-config.service.ts b/src/app/services/system-config.service.ts index 45ab9fb1f..db715e43d 100644 --- a/src/app/services/system-config.service.ts +++ b/src/app/services/system-config.service.ts @@ -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']; diff --git a/src/app/services/system-connections.service.ts b/src/app/services/system-connections.service.ts index 09a66c8a4..d196da228 100644 --- a/src/app/services/system-connections.service.ts +++ b/src/app/services/system-connections.service.ts @@ -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(this.systemConfigUrl) .pipe( - retry(apiRetry), map(res => { return res; }) diff --git a/src/app/services/system-status.service.ts b/src/app/services/system-status.service.ts index b5e88f1a5..ca9a18bbe 100644 --- a/src/app/services/system-status.service.ts +++ b/src/app/services/system-status.service.ts @@ -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(this.systemStatusUrl) .pipe( - retry(apiRetry), map(res => { return res; })