UNPKG

redis-smq

Version:

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

19 lines 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._isBackgroundJobWorkerAlive = _isBackgroundJobWorkerAlive; const with_shared_pool_connection_js_1 = require("../../../redis/redis-connection-pool/with-shared-pool-connection.js"); const redis_keys_js_1 = require("../../../redis/redis-keys/redis-keys.js"); const redis_smq_common_1 = require("redis-smq-common"); const _get_background_job_worker_js_1 = require("./_get-background-job-worker.js"); function _isBackgroundJobWorkerAlive(jobId, cb) { (0, with_shared_pool_connection_js_1.withSharedPoolConnection)((client, cb) => { redis_smq_common_1.async.waterfall([ (cb) => (0, _get_background_job_worker_js_1._getBackgroundJobWorker)(jobId, cb), (workerId, cb) => { const { keyWorkerHeartbeat } = redis_keys_js_1.redisKeys.getWorkerKeys(workerId); redis_smq_common_1.Heartbeat.isComponentAlive(client, keyWorkerHeartbeat, cb); }, ], cb); }, cb); } //# sourceMappingURL=_is-background-job-worker-alive.js.map