UNPKG

redis-smq

Version:

A high-performance, reliable, and scalable message queue for Node.js.

18 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._lockQueuelock = _lockQueuelock; const index_js_1 = require("../../queue-manager/index.js"); const index_js_2 = require("../types/index.js"); const _transit_queue_to_js_1 = require("./_transit-queue-to.js"); function _lockQueuelock(queue, lockOwner, lockId, options, logger, cb) { const queueDesc = typeof queue === 'string' ? queue : `${queue.name}@${queue.ns}`; logger.debug(`Locking queue: ${queueDesc} for ${lockOwner}. Lock ID: ${lockId}.`); (0, _transit_queue_to_js_1._transitQueueTo)(queue, index_js_1.EQueueOperationalState.LOCKED, { reason: (options === null || options === void 0 ? void 0 : options.reason) || index_js_2.EStateTransitionReason.MANUAL, description: (options === null || options === void 0 ? void 0 : options.description) || 'Exclusive lock', lockId, lockOwner, metadata: options === null || options === void 0 ? void 0 : options.metadata, }, logger, cb); } //# sourceMappingURL=_lock-queue.js.map