Currently there is a race condition that occurs between the dbjobqueue enqueue and dequeue functions. Both queries make use of the postgres `now()` timestamp function which returns the timestamp of when the transaction started and not when the statement is executed. The result of this is a timestamp for a job's `started_at` field to be earlier than its `queued_at` field causing a constraint violation. Since the dequeue query will never be executed before the enqueue query, changing the postgres timestamp function to `statement_timestamp()` resolves this issue. |
||
|---|---|---|
| .. | ||
| schemas | ||
| dbjobqueue.go | ||