remove deprecated retryWhen
This commit is contained in:
parent
9596338ed8
commit
8e15298919
@ -1,7 +1,7 @@
|
||||
import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpStatusCode } from '@angular/common/http';
|
||||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
import { MonoTypeOperatorFunction, Observable, pipe, throwError, timer } from 'rxjs';
|
||||
import { catchError, mergeMap, retryWhen, tap } from 'rxjs/operators';
|
||||
import { MonoTypeOperatorFunction, Observable, pipe, retry, throwError, timer } from 'rxjs';
|
||||
import { catchError, mergeMap, tap } from 'rxjs/operators';
|
||||
import { MAX_RETRIES_ON_SERVER_ERROR } from './max-retries.token';
|
||||
import { ErrorService } from './error.service';
|
||||
import { KeycloakService } from 'keycloak-angular';
|
||||
@ -20,7 +20,7 @@ function backoffOnServerError(maxRetries = 3): MonoTypeOperatorFunction<HttpEven
|
||||
tap<HttpErrorResponse>(() => (seconds = updateSeconds(seconds))),
|
||||
mergeMap((error: HttpErrorResponse, index) => {
|
||||
if ((error.status < HttpStatusCode.InternalServerError && error.status !== 0) || index === maxRetries) {
|
||||
return throwError(error);
|
||||
return throwError(() => error);
|
||||
}
|
||||
|
||||
console.error('An error occurred: ', error);
|
||||
@ -28,7 +28,7 @@ function backoffOnServerError(maxRetries = 3): MonoTypeOperatorFunction<HttpEven
|
||||
return timer(seconds * 1000);
|
||||
}),
|
||||
);
|
||||
return retryWhen(errors => errors.pipe(timerExpiration));
|
||||
return retry({ delay: (errors: Observable<HttpErrorResponse>) => errors.pipe(timerExpiration) });
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@ -55,7 +55,7 @@ export class ServerErrorInterceptor implements HttpInterceptor {
|
||||
this._urlsWithError.add(req.url);
|
||||
}
|
||||
|
||||
return throwError(error);
|
||||
return throwError(() => error);
|
||||
}),
|
||||
backoffOnServerError(this._maxRetries || 3),
|
||||
tap(() => {
|
||||
|
||||
@ -73,7 +73,7 @@ export class WorkflowComponent<T extends IListable, K extends string> extends Au
|
||||
if (event.previousContainer !== event.container) {
|
||||
const column = this._getColumnByKey((<unknown>event.container.id) as K);
|
||||
await column.enterFn(this.draggingEntities$.value);
|
||||
this.listingService.setSelected([]); // TODO: Clear only when moving selected???
|
||||
this.listingService.setSelected([]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user