@djgrant/pg-taskq
Advanced tools
Comparing version 1.0.0-alpha.36 to 1.0.0-alpha.37
{ | ||
"name": "@djgrant/pg-taskq", | ||
"version": "1.0.0-alpha.36", | ||
"version": "1.0.0-alpha.37", | ||
"description": "A Postgres backed task queue for NodeJS", | ||
@@ -33,3 +33,3 @@ "author": "Daniel Grant <hello@danielgrant.co>", | ||
}, | ||
"gitHead": "18bbce5aaa375bad486721ac0f9155b32772e3cd" | ||
"gitHead": "81356e8d1c3a376e2164af26f9d8832d150d8034" | ||
} |
@@ -21,2 +21,3 @@ declare module "@djgrant/pg-taskq" { | ||
priority?: number; | ||
status?: string; | ||
}): Promise<void>; | ||
@@ -23,0 +24,0 @@ schedule(opts: { |
@@ -57,5 +57,6 @@ const sql = require("sql-template-strings"); | ||
priority = 0, | ||
status = null, | ||
}) => sql` | ||
INSERT INTO tasks (name, params, context, parent_id, execute_at, priority) | ||
VALUES (${name}, ${params}, ${context}, ${parentId}, ${executeAtDateTime}, ${priority}) | ||
INSERT INTO tasks (name, params, context, parent_id, execute_at, status, priority) | ||
VALUES (${name}, ${params}, ${context}, ${parentId}, ${executeAtDateTime}, ${status}, ${priority}) | ||
ON CONFLICT (name, execute_at, md5(params::text), md5(context::text)) DO NOTHING | ||
@@ -72,5 +73,6 @@ RETURNING *; | ||
priority = 0, | ||
status = null, | ||
}) => sql` | ||
INSERT INTO tasks (name, params, context, parent_id, execute_at, priority) | ||
VALUES (${name}, ${params}, ${context}, ${parentId}, now() + ${executeIn}::interval, ${priority}) | ||
INSERT INTO tasks (name, params, context, parent_id, execute_at, status, priority) | ||
VALUES (${name}, ${params}, ${context}, ${parentId}, now() + ${executeIn}::interval, ${status}, ${priority}) | ||
ON CONFLICT (name, execute_at, md5(params::text), md5(context::text)) DO NOTHING | ||
@@ -87,5 +89,6 @@ RETURNING *; | ||
priority = 0, | ||
status = null, | ||
}) => sql` | ||
INSERT INTO tasks (name, params, context, parent_id, execute_at, priority) | ||
VALUES (${name}, ${params}, ${context}, ${parentId}, ${datetime}::timestamp with time zone + ${interval}::interval, ${priority}) | ||
INSERT INTO tasks (name, params, context, parent_id, execute_at, status, priority) | ||
VALUES (${name}, ${params}, ${context}, ${parentId}, ${datetime}::timestamp with time zone + ${interval}::interval, ${status}, ${priority}) | ||
ON CONFLICT (name, execute_at, md5(params::text), md5(context::text)) DO NOTHING | ||
@@ -92,0 +95,0 @@ RETURNING *; |
@@ -121,3 +121,3 @@ const { Pool } = require("pg"); | ||
const taskq = parent ? parent.taskq : this; | ||
return taskq.enqueue({ ...task, ...overrides }); | ||
return taskq.enqueue({ ...task, status: null, ...overrides }); | ||
}; | ||
@@ -344,2 +344,3 @@ | ||
parentId: task.parentId || (this.parentTask && this.parentTask.id), | ||
status: task.status, | ||
}) | ||
@@ -346,0 +347,0 @@ ) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43502
928