Skip to content

Ignore future jobs in jobs:check.#1159

Open
joshuapinter wants to merge 2 commits into
collectiveidea:masterfrom
joshuapinter:patch-1
Open

Ignore future jobs in jobs:check.#1159
joshuapinter wants to merge 2 commits into
collectiveidea:masterfrom
joshuapinter:patch-1

Conversation

@joshuapinter

@joshuapinter joshuapinter commented Dec 13, 2021

Copy link
Copy Markdown

Ignore future jobs in jobs:check.

If there are scheduled jobs in the future, they should not be included in the jobs:check, which is intended to look for jobs that should be processed but have not yet been processed.

To accomplish this we check if the run_at is before the max_age (default: 300 seconds) instead of the created_at.

Comment thread lib/delayed/tasks.rb Outdated
… jobs:check.

If a job is currently being processed, we want an option to exclude them from being reported in `jobs:check`.

`jobs:check`’s primary purpose should be to see the outstanding queue, not determining long-running jobs.

Made this option default to false so no breaking changes but simply pass true for `not_locked` to exclude them from this check.

Remove extra `AND`.
If there are scheduled jobs in the future, they should not be included in the jobs:check, which is intended to look for jobs that should be processed but have not yet been processed.

To accomplish this we check if the `run_at` is before the `max_age` (default: 300 seconds) instead of the `created_at`.
@joshuapinter

Copy link
Copy Markdown
Author

@albus522 Change made to only query against run_at and the branch has been rebased against master.

Let me know if you need any other changes to get this merged in. And thanks for the feedback and patience! :)

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