Skip to content

Conversation

@ric2b
Copy link

@ric2b ric2b commented Oct 19, 2025

Problem

When a job is enqueued without scheduled_at being set the app/views/mission_control/jobs/jobs/show.html.erb template breaks as the duration calculation currently expects scheduled_at to have a value.

Solution

Calculate the duration with enqueued_at if scheduled_at is nil.

Fixes #282

@ric2b
Copy link
Author

ric2b commented Oct 22, 2025

Looks like this might not be necessary after SolidQueue 1.2.2 was released? It includes this fix: rails/solid_queue#637

Although I'm not sure if ActiveJob expects every job to have scheduled_at populated or not, this might still be an issue in other backends if it's not mandatory.

@rosa
Copy link
Member

rosa commented Oct 28, 2025

I think this is a good idea regardless! Thank you.

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.

job.scheduled_at cannot be assumed and crashes job.duration

2 participants