Purge
pulse.purge()
pulse.purge()
Example Usage
const pulse = new Pulse();
pulse.define('emailNotification', async (job) => {
// Processing logic here
});
pulse.define('dataBackup', async (job) => {
// Processing logic here
});
// Remove all jobs that are not defined as 'emailNotification' or 'dataBackup'
pulse.purge()
.then(deletedCount => console.log(`${deletedCount} undefined jobs purged from the system`))
.catch(error => console.error('Failed to purge jobs:', error));
Returns
Promise<number | undefined>
: A promise that resolves with the number of jobs that were deleted from the database. If no jobs were deleted, the promise may resolve toundefined
.
Last updated
Was this helpful?