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 b45193a commit c13cb57
Showing 1 changed file with 3 additions and 3 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) { console.error('TIMEOUT OCCURED');
if (currentTime - lastProgressTimestamp >= progressTimeoutDuration) { console.error('TIMEOUT OCCURED 1');
return throwError(() => new FileUploadTimeoutError());
} else {
// No timeout needed as a progress event was received within the duration
Expand Down Expand Up @@ -190,8 +190,8 @@ export class FileUploadService {
// }),

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

0 comments on commit c13cb57

Please sign in to comment.