Skip to content

Commit

Permalink
fix: add progress timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
uzenith360 committed Dec 16, 2023
1 parent 7ee510b commit f58cad3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class FileUploadService {
with: () => {
const currentTime: number = Date.now();

if (currentTime - lastProgressTimestamp >= progressTimeoutDuration) {
if (currentTime - lastProgressTimestamp >= progressTimeoutDuration) { console.error('TIMEOUT OCCURED');
return throwError(() => new FileUploadTimeoutError());
} else {
// No timeout needed as a progress event was received within the duration
Expand Down Expand Up @@ -190,7 +190,7 @@ export class FileUploadService {
// }),

catchError((err: HttpErrorResponse, caught: Observable<HttpResponse<void> | HttpUploadProgressEvent>) => {
if (err instanceof FileUploadTimeoutError) {
if (err instanceof FileUploadTimeoutError) { console.error('TIMEOUT OCCURED');
return throwError(() => err);
} else {
switch (err.status) {
Expand Down

0 comments on commit f58cad3

Please sign in to comment.