-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove deprecated advisory lock uniqueness, consolidate insert logic
This removes the original unique jobs implementation in its entirety. It was already deprecated in the previous release. All known use cases are better supported with the new unique jobs implementation which is also dramatically faster and supports batch insertion. As part of this change, single insertions now inherit the behavior of batch insertions as far as always setting a `scheduled_at` time in the job args prior to hitting the database. This is due to the difficulty of trying to pass an array of nullable timestamps for `scheduled_at` to the database using sqlc. One side effect of this is that some tests needed to be updated because they run in a transaction, which locks in a particular `now()` time used in `JobGetAvailble` by default. Jobs inserted _after_ the start of that transaction would pick up a scheduled timestamp from Go code that is _later_ than the database transaction's timestamp, and so those jobs would never run. This was fixed in some cases by allowing `now` to be overridden by lower level callers of that query, whereas other tests were updated to simply insert jobs with a past `scheduled_at` to ensure their visibility.
- Loading branch information
Showing
21 changed files
with
288 additions
and
1,110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.