Skip to content

Commit

Permalink
Prevent jobs from being enqueued in the past.
Browse files Browse the repository at this point in the history
It's relatively easy for this to happen by accident (e.g. time drift on
a rogue server), and it throws a spanner in the works if you're
monitoring for oldest job in the queue.
  • Loading branch information
xaviershay authored and dtcristo committed Oct 17, 2023
1 parent bcec606 commit f8d99b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/que/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Job
(
coalesce($1, 'default')::text,
coalesce($2, 100)::smallint,
coalesce($3, now())::timestamptz,
greatest($3, now())::timestamptz,
$4::text,
coalesce($5, '[]')::jsonb,
coalesce($6, '{}')::jsonb,
Expand All @@ -37,7 +37,7 @@ class Job
SELECT
coalesce($1, 'default')::text,
coalesce($2, 100)::smallint,
coalesce($3, now())::timestamptz,
greatest($3, now())::timestamptz,
$4::text,
args_and_kwargs.args,
args_and_kwargs.kwargs,
Expand Down

0 comments on commit f8d99b5

Please sign in to comment.