Skip to content

Commit b7f30e6

Browse files
committed
do not modify existing jobs values if found in _hb_jobs
1 parent a2ad4e8 commit b7f30e6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Sources/JobsPostgres/PostgresJobsQueue.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,8 @@ public final class PostgresJobQueue: JobQueueDriver {
280280
"""
281281
INSERT INTO _hb_pg_job_queue (job_id, createdAt, delayed_until)
282282
VALUES (\(jobId), \(Date.now), \(delayUntil))
283-
ON CONFLICT (job_id)
284-
DO UPDATE
285-
SET delayed_until = COALESCE(_hb_pg_job_queue.delayed_until, EXCLUDED.delayed_until),
286-
createdAt = \(Date.now)
283+
-- We have found an existing job with the same id, SKIP this INSERT
284+
ON CONFLICT (job_id) DO NOTHING
287285
""",
288286
logger: self.logger
289287
)

0 commit comments

Comments
 (0)