enable stalled job disabling
This commit is contained in:
parent
b9c16331ce
commit
96c110abe6
|
@ -4,11 +4,11 @@ import * as automation from "../threads/automation"
|
||||||
|
|
||||||
export const addListeners = (queue: Queue) => {
|
export const addListeners = (queue: Queue) => {
|
||||||
logging(queue)
|
logging(queue)
|
||||||
// handleStalled(queue)
|
handleStalled(queue)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleStalled = (queue: Queue) => {
|
const handleStalled = (queue: Queue) => {
|
||||||
queue.on("active", async (job: Job) => {
|
queue.on("stalled", async (job: Job) => {
|
||||||
await automation.removeStalled(job as AutomationEvent)
|
await automation.removeStalled(job as AutomationEvent)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -473,9 +473,9 @@ export function execute(input: AutomationEvent, callback: WorkerCallback) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const removeStalled = (input: AutomationEvent) => {
|
export const removeStalled = async (input: AutomationEvent) => {
|
||||||
const appId = input.data.event.appId
|
const appId = input.data.event.appId
|
||||||
doInAppContext(appId, async () => {
|
await doInAppContext(appId, async () => {
|
||||||
const automationOrchestrator = new Orchestrator(
|
const automationOrchestrator = new Orchestrator(
|
||||||
input.data.automation,
|
input.data.automation,
|
||||||
input.data.event,
|
input.data.event,
|
||||||
|
|
Loading…
Reference in New Issue