UNPKG

@cavai/adonis-queue

Version:
31 lines (30 loc) 769 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseJob = void 0; const Dispatcher_1 = require("./Dispatcher"); class BaseJob { constructor(..._) { } /** * Sets queueManager to current job */ static useQueue(queueManager) { this.queueManager = queueManager; } /** * Dispatches job to be queued up for execution * * @param data Data to pass to job class instance */ static dispatch(...data) { return new Dispatcher_1.Dispatcher(this, data); } } /** * Nr of times job is re-tried before it is marked as failed */ BaseJob.retries = 0; /** * Delay for retries in seconds, so other jobs get chance to run */ BaseJob.retryAfter = 5; exports.BaseJob = BaseJob;