Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheodoreKrypton committed May 11, 2024
1 parent b442d29 commit fdfff82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
12 changes: 1 addition & 11 deletions src/api/client/message-api/file-uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ export abstract class FileUploader<T extends GeneralFileMessage> {

const chunk = await this.read(chunkLength.toJSNumber());

let retry = 3;
while (retry) {
while (true) {
try {
const rsp = this.isBig
? await this.client.saveBigFilePart({
Expand Down Expand Up @@ -108,15 +107,6 @@ export abstract class FileUploader<T extends GeneralFileMessage> {
throw new FileTooBig(this.fileSize);
}
}

Logger.error(
`error encountered in uploading worker ${workerId}: ${err} retries left: ${retry}`,
);

retry -= 1;
if (retry === 0) {
throw err;
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function retry(
const result = await originalMethod.apply(this, args);
return result;
} catch (error) {
console.error(error);
if (i === retries) throw error;
const waitTime = Math.pow(2, i) * backoff;
Logger.error(
Expand Down

0 comments on commit fdfff82

Please sign in to comment.