diff --git a/lib/que/job.rb b/lib/que/job.rb index 6093b162..6c6609ac 100644 --- a/lib/que/job.rb +++ b/lib/que/job.rb @@ -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, @@ -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,