isRunning
pulse.isRunning(useRealStatus?)
pulse.isRunning(useRealStatus?)
Example Usage
const pulse = new Pulse();
pulse.define('test', async (job) => {
if (job.isRunning()) {
console.log('The job is currently running.');
} else {
console.log('The job is not running.');
}
});
Parameters
useRealStatus
(boolean
- optional): Iftrue
, the job will query the database to refresh its status before determining if it is running. This ensures the method uses the most current data available. Defaults tofalse
, which uses the status as currently loaded in the job object.
Returns
boolean
: Returnstrue
if the job is currently running, otherwisefalse
.
Last updated
Was this helpful?