Socket
Socket
Sign inDemoInstall

bullmq

Package Overview
Dependencies
Maintainers
1
Versions
531
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bullmq - npm Package Compare versions

Comparing version 5.4.2 to 5.4.3

9

dist/cjs/classes/flow-producer.js

@@ -5,3 +5,2 @@ "use strict";

const events_1 = require("events");
const lodash_1 = require("lodash");
const uuid_1 = require("uuid");

@@ -151,9 +150,9 @@ const utils_1 = require("../utils");

addNode({ multi, node, parent, queuesOpts }) {
var _a;
var _a, _b;
const prefix = node.prefix || this.opts.prefix;
const queue = this.queueFromNode(node, new queue_keys_1.QueueKeys(prefix), prefix);
const queueOpts = queuesOpts && queuesOpts[node.queueName];
const jobsOpts = (0, lodash_1.get)(queueOpts, 'defaultJobOptions');
const jobId = ((_a = node.opts) === null || _a === void 0 ? void 0 : _a.jobId) || (0, uuid_1.v4)();
const job = new this.Job(queue, node.name, node.data, Object.assign(Object.assign(Object.assign({}, (jobsOpts ? jobsOpts : {})), node.opts), { parent: parent === null || parent === void 0 ? void 0 : parent.parentOpts }), jobId);
const jobsOpts = (_a = queueOpts === null || queueOpts === void 0 ? void 0 : queueOpts.defaultJobOptions) !== null && _a !== void 0 ? _a : {};
const jobId = ((_b = node.opts) === null || _b === void 0 ? void 0 : _b.jobId) || (0, uuid_1.v4)();
const job = new this.Job(queue, node.name, node.data, Object.assign(Object.assign(Object.assign({}, jobsOpts), node.opts), { parent: parent === null || parent === void 0 ? void 0 : parent.parentOpts }), jobId);
const parentKey = (0, utils_1.getParentKey)(parent === null || parent === void 0 ? void 0 : parent.parentOpts);

@@ -160,0 +159,0 @@ if (node.children && node.children.length > 0) {

@@ -7,3 +7,2 @@ "use strict";

*/
const lodash_1 = require("lodash");
const child_processor_1 = require("./child-processor");

@@ -34,4 +33,4 @@ const enums_1 = require("../enums");

process.on('uncaughtException', async (err) => {
if (!err.message) {
err = new Error((0, lodash_1.toString)(err));
if (typeof err !== 'object') {
err = new Error((0, utils_1.toString)(err));
}

@@ -38,0 +37,0 @@ await send({

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Queue = void 0;
const lodash_1 = require("lodash");
const uuid_1 = require("uuid");

@@ -21,7 +20,8 @@ const job_1 = require("./job");

this.token = (0, uuid_1.v4)();
this.jobsOpts = (_a = (0, lodash_1.get)(opts, 'defaultJobOptions')) !== null && _a !== void 0 ? _a : {};
this.jobsOpts = (_a = opts === null || opts === void 0 ? void 0 : opts.defaultJobOptions) !== null && _a !== void 0 ? _a : {};
this.waitUntilReady()
.then(client => {
var _a, _b, _c;
if (!this.closing) {
client.hset(this.keys.meta, 'opts.maxLenEvents', (0, lodash_1.get)(opts, 'streams.events.maxLen', 10000));
client.hset(this.keys.meta, 'opts.maxLenEvents', (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.streams) === null || _a === void 0 ? void 0 : _a.events) === null || _b === void 0 ? void 0 : _b.maxLen) !== null && _c !== void 0 ? _c : 10000);
}

@@ -28,0 +28,0 @@ })

@@ -21,2 +21,3 @@ "use strict";

const maximumBlockTimeout = 10;
const minimumBlockTimeout = 0.001;
/**

@@ -49,2 +50,5 @@ *

}
if (this.opts.drainDelay <= 0) {
throw new Error('drainDelay must be greater than 0');
}
this.concurrency = this.opts.concurrency;

@@ -330,3 +334,3 @@ this.opts.lockRenewTime =

if (blockDelay < 1) {
return 0.001;
return minimumBlockTimeout;
}

@@ -338,3 +342,3 @@ else {

else {
return Math.max(opts.drainDelay, 0);
return Math.max(opts.drainDelay, minimumBlockTimeout);
}

@@ -341,0 +345,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QUEUE_EVENT_SUFFIX = exports.errorToJSON = exports.parseObjectValues = exports.isRedisVersionLowerThan = exports.childSend = exports.asyncSend = exports.isNotConnectionError = exports.DELAY_TIME_1 = exports.DELAY_TIME_5 = exports.clientCommandMessageReg = exports.getParentKey = exports.removeAllQueueData = exports.decreaseMaxListeners = exports.isRedisCluster = exports.isRedisInstance = exports.invertObject = exports.increaseMaxListeners = exports.delay = exports.array2obj = exports.isEmpty = exports.lengthInUtf8Bytes = exports.tryCatch = exports.errorObject = void 0;
exports.QUEUE_EVENT_SUFFIX = exports.toString = exports.errorToJSON = exports.parseObjectValues = exports.isRedisVersionLowerThan = exports.childSend = exports.asyncSend = exports.isNotConnectionError = exports.DELAY_TIME_1 = exports.DELAY_TIME_5 = exports.clientCommandMessageReg = exports.getParentKey = exports.removeAllQueueData = exports.decreaseMaxListeners = exports.isRedisCluster = exports.isRedisInstance = exports.invertObject = exports.increaseMaxListeners = exports.delay = exports.array2obj = exports.isEmpty = exports.lengthInUtf8Bytes = exports.tryCatch = exports.errorObject = void 0;
const ioredis_1 = require("ioredis");

@@ -175,3 +175,24 @@ // eslint-disable-next-line @typescript-eslint/ban-ts-comment

exports.errorToJSON = errorToJSON;
const INFINITY = 1 / 0;
const toString = (value) => {
if (value == null) {
return '';
}
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value === 'string') {
return value;
}
if (Array.isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return `${value.map(other => (other == null ? other : (0, exports.toString)(other)))}`;
}
if (typeof value == 'symbol' ||
Object.prototype.toString.call(value) == '[object Symbol]') {
return value.toString();
}
const result = `${value}`;
return result === '0' && 1 / value === -INFINITY ? '-0' : result;
};
exports.toString = toString;
exports.QUEUE_EVENT_SUFFIX = ':qe';
//# sourceMappingURL=utils.js.map
import { EventEmitter } from 'events';
import { get } from 'lodash';
import { v4 } from 'uuid';

@@ -147,9 +146,9 @@ import { getParentKey, isRedisInstance } from '../utils';

addNode({ multi, node, parent, queuesOpts }) {
var _a;
var _a, _b;
const prefix = node.prefix || this.opts.prefix;
const queue = this.queueFromNode(node, new QueueKeys(prefix), prefix);
const queueOpts = queuesOpts && queuesOpts[node.queueName];
const jobsOpts = get(queueOpts, 'defaultJobOptions');
const jobId = ((_a = node.opts) === null || _a === void 0 ? void 0 : _a.jobId) || v4();
const job = new this.Job(queue, node.name, node.data, Object.assign(Object.assign(Object.assign({}, (jobsOpts ? jobsOpts : {})), node.opts), { parent: parent === null || parent === void 0 ? void 0 : parent.parentOpts }), jobId);
const jobsOpts = (_a = queueOpts === null || queueOpts === void 0 ? void 0 : queueOpts.defaultJobOptions) !== null && _a !== void 0 ? _a : {};
const jobId = ((_b = node.opts) === null || _b === void 0 ? void 0 : _b.jobId) || v4();
const job = new this.Job(queue, node.name, node.data, Object.assign(Object.assign(Object.assign({}, jobsOpts), node.opts), { parent: parent === null || parent === void 0 ? void 0 : parent.parentOpts }), jobId);
const parentKey = getParentKey(parent === null || parent === void 0 ? void 0 : parent.parentOpts);

@@ -156,0 +155,0 @@ if (node.children && node.children.length > 0) {

@@ -5,6 +5,5 @@ /**

*/
import { toString } from 'lodash';
import { ChildProcessor } from './child-processor';
import { ParentCommand, ChildCommand } from '../enums';
import { errorToJSON } from '../utils';
import { errorToJSON, toString } from '../utils';
export default (send, receiver) => {

@@ -32,3 +31,3 @@ const childProcessor = new ChildProcessor(send);

process.on('uncaughtException', async (err) => {
if (!err.message) {
if (typeof err !== 'object') {
err = new Error(toString(err));

@@ -35,0 +34,0 @@ }

@@ -1,2 +0,1 @@

import { get } from 'lodash';
import { v4 } from 'uuid';

@@ -18,7 +17,8 @@ import { Job } from './job';

this.token = v4();
this.jobsOpts = (_a = get(opts, 'defaultJobOptions')) !== null && _a !== void 0 ? _a : {};
this.jobsOpts = (_a = opts === null || opts === void 0 ? void 0 : opts.defaultJobOptions) !== null && _a !== void 0 ? _a : {};
this.waitUntilReady()
.then(client => {
var _a, _b, _c;
if (!this.closing) {
client.hset(this.keys.meta, 'opts.maxLenEvents', get(opts, 'streams.events.maxLen', 10000));
client.hset(this.keys.meta, 'opts.maxLenEvents', (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.streams) === null || _a === void 0 ? void 0 : _a.events) === null || _b === void 0 ? void 0 : _b.maxLen) !== null && _c !== void 0 ? _c : 10000);
}

@@ -25,0 +25,0 @@ })

@@ -18,2 +18,3 @@ import * as fs from 'fs';

const maximumBlockTimeout = 10;
const minimumBlockTimeout = 0.001;
/**

@@ -46,2 +47,5 @@ *

}
if (this.opts.drainDelay <= 0) {
throw new Error('drainDelay must be greater than 0');
}
this.concurrency = this.opts.concurrency;

@@ -327,3 +331,3 @@ this.opts.lockRenewTime =

if (blockDelay < 1) {
return 0.001;
return minimumBlockTimeout;
}

@@ -335,3 +339,3 @@ else {

else {
return Math.max(opts.drainDelay, 0);
return Math.max(opts.drainDelay, minimumBlockTimeout);
}

@@ -338,0 +342,0 @@ }

@@ -46,3 +46,4 @@ /// <reference types="node" />

export declare const errorToJSON: (value: any) => Record<string, any>;
export declare const toString: (value: any) => string;
export declare const QUEUE_EVENT_SUFFIX = ":qe";
export {};

@@ -154,3 +154,23 @@ import { Cluster } from 'ioredis';

};
const INFINITY = 1 / 0;
export const toString = (value) => {
if (value == null) {
return '';
}
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value === 'string') {
return value;
}
if (Array.isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return `${value.map(other => (other == null ? other : toString(other)))}`;
}
if (typeof value == 'symbol' ||
Object.prototype.toString.call(value) == '[object Symbol]') {
return value.toString();
}
const result = `${value}`;
return result === '0' && 1 / value === -INFINITY ? '-0' : result;
};
export const QUEUE_EVENT_SUFFIX = ':qe';
//# sourceMappingURL=utils.js.map
{
"name": "bullmq",
"version": "5.4.2",
"version": "5.4.3",
"description": "Queue for messages and jobs based on Redis",

@@ -58,3 +58,2 @@ "homepage": "https://bullmq.io/",

"ioredis": "^5.3.2",
"lodash": "^4.17.21",
"msgpackr": "^1.10.1",

@@ -61,0 +60,0 @@ "node-abort-controller": "^3.1.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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