@joystick.js/node-canary 0.0.0-canary.345 → 0.0.0-canary.346
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -131,7 +131,6 @@ var queues_default = {
|
|
|
131
131
|
CREATE TABLE IF NOT EXISTS queue_${this.queue.name} (
|
|
132
132
|
_id text PRIMARY KEY,
|
|
133
133
|
status text,
|
|
134
|
-
environment text,
|
|
135
134
|
job text,
|
|
136
135
|
payload text,
|
|
137
136
|
next_run_at text,
|
|
@@ -140,16 +139,17 @@ var queues_default = {
|
|
|
140
139
|
completed_at text,
|
|
141
140
|
failed_at text,
|
|
142
141
|
error text,
|
|
142
|
+
environment text,
|
|
143
143
|
attempts smallint
|
|
144
144
|
)
|
|
145
145
|
`);
|
|
146
|
-
db?.query(`ALTER TABLE queue_${this.queue.name} ADD COLUMN IF NOT EXISTS
|
|
147
|
-
db?.query(`ALTER TABLE queue_${this.queue.name} ADD COLUMN IF NOT EXISTS
|
|
148
|
-
db?.query(`CREATE INDEX IF NOT EXISTS status_index ON queue_${this.queue.name} (status)`);
|
|
149
|
-
db?.query(`CREATE INDEX IF NOT EXISTS status_nextRunAt_index ON queue_${this.queue.name} (status, next_run_at)`);
|
|
150
|
-
db?.query(`CREATE INDEX IF NOT EXISTS nextJob_index ON queue_${this.queue.name} (status, environment, next_run_at, locked_by)`);
|
|
151
|
-
db?.query(`CREATE INDEX IF NOT EXISTS completedAt_index ON queue_${this.queue.name} (completed_at)`);
|
|
152
|
-
db?.query(`CREATE INDEX IF NOT EXISTS failedAt_index ON queue_${this.queue.name} (failed_at)`);
|
|
146
|
+
await db?.query(`ALTER TABLE queue_${this.queue.name} ADD COLUMN IF NOT EXISTS environment text`);
|
|
147
|
+
await db?.query(`ALTER TABLE queue_${this.queue.name} ADD COLUMN IF NOT EXISTS attempts smallint`);
|
|
148
|
+
await db?.query(`CREATE INDEX IF NOT EXISTS status_index ON queue_${this.queue.name} (status)`);
|
|
149
|
+
await db?.query(`CREATE INDEX IF NOT EXISTS status_nextRunAt_index ON queue_${this.queue.name} (status, next_run_at)`);
|
|
150
|
+
await db?.query(`CREATE INDEX IF NOT EXISTS nextJob_index ON queue_${this.queue.name} (status, environment, next_run_at, locked_by)`);
|
|
151
|
+
await db?.query(`CREATE INDEX IF NOT EXISTS completedAt_index ON queue_${this.queue.name} (completed_at)`);
|
|
152
|
+
await db?.query(`CREATE INDEX IF NOT EXISTS failedAt_index ON queue_${this.queue.name} (failed_at)`);
|
|
153
153
|
if (this.queue.options?.cleanup?.completedAfterSeconds) {
|
|
154
154
|
cron.schedule("*/30 * * * * *", () => {
|
|
155
155
|
handleCleanupQueues({
|