Skip to content

Commit

Permalink
Add pending job state to default unique job states (#461)
Browse files Browse the repository at this point in the history
Add `pending` job state to default unique job states

Here, add the `pending` job state to the set of default unique states.
`pending` was a relatively recent addition in #301 and probably should
always have been in the default unique states, but `pending` isn't used
yet so no one noticed one way or the other.

---------

Co-authored-by: Blake Gentry <[email protected]>
  • Loading branch information
brandur and bgentry authored Jul 19, 2024
1 parent 5a9d096 commit 0ba7ed4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ river migrate-up --database-url "$DATABASE_URL"

- Tags are now limited to 255 characters in length, and should match the regex `\A[\w][\w\-]+[\w]\z` (importantly, they can't contain commas). [PR #351](https://github.com/riverqueue/river/pull/351).
- Many info logging statements have been demoted to debug level. [PR #452](https://github.com/riverqueue/river/pull/452).
- `pending` is now part of the default set of unique job states. [PR #461](https://github.com/riverqueue/river/pull/461).

## [0.9.0] - 2024-07-04

Expand Down
1 change: 1 addition & 0 deletions internal/dbunique/db_unique.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
var defaultUniqueStates = []rivertype.JobState{ //nolint:gochecknoglobals
rivertype.JobStateAvailable,
rivertype.JobStateCompleted,
rivertype.JobStatePending,
rivertype.JobStateRetryable,
rivertype.JobStateRunning,
rivertype.JobStateScheduled,
Expand Down
1 change: 1 addition & 0 deletions internal/dbunique/db_unique_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ func TestUniqueInserter_JobInsert(t *testing.T) {
// already been done above.
for _, defaultState := range []rivertype.JobState{
rivertype.JobStateCompleted,
rivertype.JobStatePending,
rivertype.JobStateRunning,
rivertype.JobStateRetryable,
rivertype.JobStateScheduled,
Expand Down

0 comments on commit 0ba7ed4

Please sign in to comment.