Socket
Socket
Sign inDemoInstall

oxen-queue

Package Overview
Dependencies
14
Maintainers
6
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.6 to 0.1.7

16

lib/queue.js

@@ -28,2 +28,4 @@ const crypto = require('crypto')

polling_backoff_rate = 1.1,
onJobSuccess = async () => {},
onJobError = async () => {}
}) {

@@ -48,2 +50,6 @@ if (!mysql_config) {

/* Callbacks */
this.onJobError = onJobError
this.onJobSuccess = onJobSuccess
/* Database */

@@ -219,7 +225,7 @@ this.db = mysql.createPool(mysql_config).promise()

.then(async job_result => {
return _this.handleSuccess({ job_id: job.id, job_result })
return _this.handleSuccess({ job_id: job.id, job_result, job_body:job.body })
})
.catch(async error => {
//job failed
return _this.handleError({ job_id: job.id, error })
return _this.handleError({ job_id: job.id, error, job_body: job.body })
})

@@ -286,3 +292,4 @@ }

async handleSuccess({ job_id, job_result }) {
async handleSuccess({ job_id, job_result, job_body }) {
await this.onJobSuccess({ job_id, job_body, job_type: this.job_type, job_result })
return this.dbQry(

@@ -309,3 +316,4 @@ `

async handleError({ job_id, error }) {
async handleError({ job_id, error, job_body }) {
await this.onJobError({ job_id, job_body, job_type: this.job_type, error })
return this.dbQry(

@@ -312,0 +320,0 @@ `

{
"name": "oxen-queue",
"version": "0.1.6",
"version": "0.1.7",
"description": "A resilient worker queue backed by MySQL.",

@@ -5,0 +5,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc