Skip to content

How does the job cache and polling relate to each other? #361

Answered by bensheldon
aried3r asked this question in Q&A
Discussion options

You must be logged in to vote

Fantastic question! Let me try to explain this cohesively, and then please poke holes in it.

Every perform_later job gets written to the database, regardless of whether it's now or wait/wait_until. (fyi, perform_now always sidesteps the Adapter and runs directly by ActiveJob, that's an ActiveJob thing and commonly trips people up). Only jobs that have await/wait_until will go into the job cache.

The job cache lives at the thread pool executor level, which is a GoodJob::Scheduler. If you're using multiple pools with a semicolon (GOOD_JOB_QUEUES="mice:2;elephants:3"), your process has multiple Schedulers, and thus multiple job caches.

The job cache isn't really a cache of specific jobs, but…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@aried3r
Comment options

@bensheldon
Comment options

Answer selected by aried3r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants