Skip to content

Fix uninitialized value warning for failed jobs without timestamps in admin UI - #146

Open
SAY-5 wants to merge 1 commit into
mojolicious:mainfrom
SAY-5:fix-failed-job-runtime-warning
Open

Fix uninitialized value warning for failed jobs without timestamps in admin UI#146
SAY-5 wants to merge 1 commit into
mojolicious:mainfrom
SAY-5:fix-failed-job-runtime-warning

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

A failed job that never started (for example one failed while still queued, with started and finished both empty) makes the admin jobs list render $job->{finished} - $job->{started} on two undefined values, producing Use of uninitialized value in subtraction (-) at template minion/jobs.html.ep line 135. This computes and shows the runtime cell only when both started and the end timestamp are defined; otherwise the job falls through to the existing waiting cell.

Motivation

The warning shows up in the web admin at /minion/jobs?state=failed for such jobs, as reported in #145. The duration column has no meaningful value when a job has no start/end times, so guarding the subtraction avoids the noise and keeps the runtime cell reserved for jobs that actually ran.

References

Fixes #145

… admin UI

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
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.

Use of uninitialized value in subtraction (-) at template minion/jobs.html.ep line 135.

1 participant