Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immediately fetch another batch when a full set of job is returned #663

Closed
wants to merge 1 commit into from

Conversation

gaffneyc
Copy link
Contributor

@gaffneyc gaffneyc commented Nov 1, 2024

Jobs can often be stuck on queues for a long while when jobs are sporadically enqueued in large batches. Prior to this change jobs would be fetched every FetchPollInterval (default 1s) unless new jobs were enqueued. This change reduces that to FetchCooldown (default 100ms) when a full set of jobs is returned implying that there may be more in the queue.

See #652 for benchmarks and further discussion.

Jobs can often be stuck on queues for a long while when jobs are
sporadically enqueued in large batches. Prior to this change jobs would
be fetched every FetchPollInterval (default 1s) unless new jobs were
enqueued. This change reduces that to FetchCooldown (default 100ms) when
a full set of jobs is returned implying that there may be more in the
queue.
@gaffneyc
Copy link
Contributor Author

gaffneyc commented Nov 1, 2024

riverqueue/rivercla#7

@bgentry
Copy link
Contributor

bgentry commented Nov 1, 2024

@gaffneyc awesome, thank you! I'm gonna see if I can get some test coverage around this change before merging it in.

@bgentry
Copy link
Contributor

bgentry commented Nov 2, 2024

An alternative version of this was merged in #664, thank you again! 🙏

@bgentry bgentry closed this Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants