forked from acaloiaro/neoq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94d7d68
commit af450bf
Showing
14 changed files
with
663 additions
and
193 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
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
3 changes: 3 additions & 0 deletions
3
backends/postgres/migrations/20240101191302_add_unique_on_fingerprint_constraint.down.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DROP CONSTRAINT neoq_jobs_fingerprint_run_unique_idx; | ||
DROP INDEX neoq_jobs_fingerprint_unique_idx; | ||
CREATE UNIQUE INDEX IF NOT EXISTS neoq_jobs_fingerprint_unique_idx ON neoq_jobs (fingerprint, status) WHERE NOT (status = 'processed'); |
3 changes: 3 additions & 0 deletions
3
backends/postgres/migrations/20240101191302_add_unique_on_fingerprint_constraint.up.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CREATE UNIQUE INDEX IF NOT EXISTS neoq_jobs_fingerprint_run_unique_idx ON neoq_jobs (queue, fingerprint, status, ran_at); | ||
DROP INDEX neoq_jobs_fingerprint_unique_idx; | ||
CREATE UNIQUE INDEX IF NOT EXISTS neoq_jobs_fingerprint_unique_idx ON neoq_jobs (queue, fingerprint, status) WHERE NOT (status = 'processed'); |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package backends | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/acaloiaro/neoq" | ||
"github.com/stretchr/testify/suite" | ||
) | ||
|
||
type NeoQTestSuite struct { | ||
suite.Suite | ||
NeoQ neoq.Neoq | ||
} | ||
|
||
// NewNeoQTestSuite constructs a new NeoQ test suite that can be used to test | ||
// any impementation of the queue | ||
func NewNeoQTestSuite(q neoq.Neoq) *NeoQTestSuite { | ||
n := new(NeoQTestSuite) | ||
n.NeoQ = q | ||
return n | ||
} | ||
|
||
func (s *NeoQTestSuite) Run(t *testing.T) { | ||
suite.Run(t, s) | ||
} | ||
|
||
func (s *NeoQTestSuite) TearDownSuite() { | ||
s.NeoQ.Shutdown(context.Background()) | ||
} |
Oops, something went wrong.