ActionHero v24.0.3 Release Notes

Release Date: 2020-11-04 // over 3 years ago
  • ๐Ÿ‘ท Suppress "Job already enqueued at this time with same arguments" errors with recurring tasks #1641

    โž• Adds an option to task.enqueueAt() and task.enqueueIn() to suppress errors if there is a duplicate task at the same time with the same arguments. We use this new setting when (re)enqueueing periodic tasks.

    /\*\* \* Enqueue a task to be performed in the background, at a certain time in the future. \* Will throw an error if redis cannot be reached. \* \* Inputs: \* \* taskName: The name of the task. \* \* inputs: inputs to pass to the task. \* \* queue: (Optional) Which queue/priority to run this instance of the task on. \* \* suppressDuplicateTaskError: (optional) Suppress errors when the same task with the same arguments are double-enqueued for the same time \*/export async function enqueueAt(timestamp: number,taskName: string,inputs: TaskInputs,queue: string = api.tasks.tasks[taskName].queue,suppressDuplicateTaskError = false) {await validateInput(taskName, inputs);return api.resque.queue.enqueueAt(timestamp,queue,taskName,[inputs],suppressDuplicateTaskError);}/\*\* \* Enqueue a task to be performed in the background, at a certain number of ms from now. \* Will throw an error if redis cannot be reached. \* \* Inputs: \* \* timestamp: At what time the task is able to be run. Does not guarantee that the task will be run at this time. (in ms) \* \* taskName: The name of the task. \* \* inputs: inputs to pass to the task. \* \* queue: (Optional) Which queue/priority to run this instance of the task on. \* \* suppressDuplicateTaskError: (optional) Suppress errors when the same task with the same arguments are double-enqueued for the same time \*/export async function enqueueIn(time: number,taskName: string,inputs: TaskInputs,queue: string = api.tasks.tasks[taskName].queue,suppressDuplicateTaskError = false) {await validateInput(taskName, inputs);return api.resque.queue.enqueueIn(time,queue,taskName,[inputs],suppressDuplicateTaskError);}
    

    ๐Ÿ”€ Merges in the changes from Node Resque:

    WS client state back to 'connected' on reconnect event #1639