Skip to content

Commit 38bd9b4

Browse files
committed
refactor: add delay and backoff to upload queue
1 parent 571f56c commit 38bd9b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modules/upload/queue/upload.producer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ export class UploadProducer {
1010
constructor(@InjectQueue(UPLOAD_QUEUE) private uploadQueue: Queue) { }
1111

1212
async uploadFile(payload: UploadFileJobDto) {
13-
return await this.uploadQueue.add(`uploadFileToArweave`, payload);
13+
return this.uploadQueue.add(`uploadFileToArweave`, payload, { delay: 1000, attempts: 7, backoff: { type: 'exponential', delay: 10000 } });
1414
}
1515
}

0 commit comments

Comments
 (0)