Home > Mobile >  How to stop a queue in NestJs, perform an action and then resume that same queue
How to stop a queue in NestJs, perform an action and then resume that same queue

Time:05-25

I’m trying to make the queue of file upload and I’m having a problem, I need to upload the file to s3 bucket in the async function into the queue, but, my queue finalize before the upload file are completed. As can be seeing in the image, the consoles indicates step by step of my queue and the "job completed" appear before of "File upload!", how can I fix it?

queue image at file upload time

CodePudding user response:

Firstly, it is not possible to use async/await with forEach and as a new array is not needed, it would not be the best option to use the map, instead, choose to use for..of.

Your problem is apparently being caused by you doing data processing in a consumer utility hook, try using another process for this task.

  • Related