Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@djgrant/pg-taskq

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@djgrant/pg-taskq - npm Package Compare versions

Comparing version 1.0.0-alpha.36 to 1.0.0-alpha.37

4

package.json
{
"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 @@ )

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc