UNPKG

redis-smq

Version:

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

16 lines 789 B
import { withSharedPoolConnection } from '../../../redis/redis-connection-pool/with-shared-pool-connection.js'; import { redisKeys } from '../../../redis/redis-keys/redis-keys.js'; import { async, Heartbeat } from 'redis-smq-common'; import { _getBackgroundJobWorker } from './_get-background-job-worker.js'; export function _isBackgroundJobWorkerAlive(jobId, cb) { withSharedPoolConnection((client, cb) => { async.waterfall([ (cb) => _getBackgroundJobWorker(jobId, cb), (workerId, cb) => { const { keyWorkerHeartbeat } = redisKeys.getWorkerKeys(workerId); Heartbeat.isComponentAlive(client, keyWorkerHeartbeat, cb); }, ], cb); }, cb); } //# sourceMappingURL=_is-background-job-worker-alive.js.map