isExpired
pulse.isExpired(useRealStatus?)
pulse.isExpired(useRealStatus?)
Example Usage
const pulse = new Pulse();
pulse.define('test', async (job) => {
if (job.isExpired()) {
console.log('The job lock has expired.');
} else {
console.log('The job lock is still valid.');
}
});
Parameters
useRealStatus
(boolean
- optional): Iftrue
, the job's current status will be refreshed from the database before checking if the lock is expired. Defaults tofalse
.
Returns
boolean
: Returnstrue
if the job's lock has expired, otherwisefalse
.
Last updated
Was this helpful?