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

Order SolidQueue failed executuions by id desc #114

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/active_job/queue_adapters/solid_queue_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def order_executions(executions)
case
# Follow polling order for scheduled executions, the rest by job_id, desc or asc
when solid_queue_status.scheduled? then executions.ordered
when solid_queue_status.failed? then executions.order(created_at: :desc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a good index for this, so this won't work in general in the case you have many failed jobs 🤔 We'll need a good index first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, indeed !

happy to help on this point, but I'm not sure of the process, especially to provide migrations to end users through an update, does it necessarily have to be done through a generator like the install migrations ?

when recurring_task_id.present? then executions.order(job_id: :desc)
else executions.order(job_id: :asc)
end
Expand Down