Closed glensc closed 4 years ago
there's another flaw in that code, if redis has no queues present, the code keeps looping due this line assigning queues empty array:
Responding just to https://github.com/actionhero/node-resque/issues/412#issuecomment-669159874, can you share more about what you mean by "the code keeps looping"?
I think the worker will never be 'ready' (which is OK as there are no queues to work), but it will sleep like normal and look for queues again the next time it tries worker#poll
Oh wow! That's certainly unexpected behavior... I'll address this in https://github.com/actionhero/node-resque/pull/413 to check for new queues periodically.
Responding just to #412 (comment), can you share more about what you mean by "the code keeps looping"?
I think the worker will never be 'ready' (which is OK as there are no queues to work), but it will sleep like normal and look for queues again the next time it tries worker#poll
I mean if the original code intended to run-once the block, then that condition would make the code to be executed every time. so there's a bug to buggy code :)
Having "queues: *" has perhaps unwanted side-effect, it will pick up queues for processing that were present at the time of worker startup:
meaning, if more queues are created to redis while runner is working, it will not "see" those queues.
this should be either fixed or documented in readme.
also, the highlighted code stores
this.originalQueue
, but that's never used elsewhere, kind of dead code smell.