-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows specifying priority when job is enqueued. Closes #7 BREAKING CHANGE: - `SCHEMA_SQL` is gone. `MIGRATOR` should be used instead. This means ADC must have exclusive rights to SQLx migrations table. Since it's rarely the case - use different schema/database for ADC. - Interface to Queue for pushing jobs includes `priority` argument
- Loading branch information
Showing
10 changed files
with
116 additions
and
167 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
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
58 changes: 29 additions & 29 deletions
58
aide-de-camp-sqlite/sql/schema.sql → ...rations/20221015223453_initial_schema.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 |
---|---|---|
@@ -1,29 +1,29 @@ | ||
CREATE TABLE IF NOT EXISTS adc_queue ( | ||
jid TEXT PRIMARY KEY, | ||
queue TEXT NOT NULL default 'default', | ||
job_type TEXT not null, | ||
payload blob not null, | ||
retries int not null default 0, | ||
scheduled_at INTEGER not null, | ||
started_at INTEGER, | ||
enqueued_at INTEGER not null default (strftime('%s', 'now')) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS adc_dead_queue ( | ||
jid TEXT PRIMARY KEY, | ||
queue TEXT NOT NULL, | ||
job_type TEXT not null, | ||
payload blob not null, | ||
retries int not null, | ||
scheduled_at INTEGER not null, | ||
started_at INTEGER not null, | ||
enqueued_at INTEGER not null, | ||
died_at INTEGER not null default (strftime('%s', 'now')) | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS adc_queue_jobs ON adc_queue ( | ||
scheduled_at asc, | ||
started_at asc, | ||
queue, | ||
job_type | ||
); | ||
CREATE TABLE IF NOT EXISTS adc_queue ( | ||
jid TEXT PRIMARY KEY, | ||
queue TEXT NOT NULL default 'default', | ||
job_type TEXT not null, | ||
payload blob not null, | ||
retries int not null default 0, | ||
scheduled_at INTEGER not null, | ||
started_at INTEGER, | ||
enqueued_at INTEGER not null default (strftime('%s', 'now')) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS adc_dead_queue ( | ||
jid TEXT PRIMARY KEY, | ||
queue TEXT NOT NULL, | ||
job_type TEXT not null, | ||
payload blob not null, | ||
retries int not null, | ||
scheduled_at INTEGER not null, | ||
started_at INTEGER not null, | ||
enqueued_at INTEGER not null, | ||
died_at INTEGER not null default (strftime('%s', 'now')) | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS adc_queue_jobs ON adc_queue ( | ||
scheduled_at asc, | ||
started_at asc, | ||
queue, | ||
job_type | ||
); |
2 changes: 2 additions & 0 deletions
2
aide-de-camp-sqlite/migrations/20221015224053_add_priority.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,2 @@ | ||
ALTER table adc_queue ADD COLUMN priority tinyint default 0; | ||
ALTER table adc_dead_queue ADD COLUMN priority tinyint default 0; |
This file was deleted.
Oops, something went wrong.
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.