PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, July 31, 2022

[FIXED] How to stop a queue in NestJs, perform an action and then resume that same queue

 July 31, 2022     file-upload, nestjs, queue, typescript     No comments   

Issue

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


Solution

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.



Answered By - Alessandro Rodrigo
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing