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