Skip to content

Exit early when no results are returned from LRANGE given jobs might already processed#521

Merged
mhenrixon merged 1 commit intomhenrixon:masterfrom
vipulnsward:exit-early
Jun 23, 2020
Merged

Exit early when no results are returned from LRANGE given jobs might already processed#521
mhenrixon merged 1 commit intomhenrixon:masterfrom
vipulnsward:exit-early

Conversation

@vipulnsward
Copy link
Contributor

Or a high load environment:

  • The length is not guaranteed to be always as such
  • Sidekiq can clear out some jobs
  • We don't need to keep iterating if the jobs have already been cleared and there are no jobs
  • This can be expensive operation to loop over unnecesarily

The other part of this is extra jobs added to the end of queue, but we can't safely predict that

(PS: My lua is weak, let me know better way if any :-) )

@mhenrixon mhenrixon self-requested a review June 23, 2020 08:15
@mhenrixon mhenrixon merged commit ef1233c into mhenrixon:master Jun 23, 2020
@vipulnsward vipulnsward deleted the exit-early branch June 23, 2020 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants