Instance methods
TriggerClient: cancelRunsForEvent() Instance Method
The cancelRunsForEvent()
instance method will cancel all the job runs (yet to be executed) that are triggered by a given eventId.
const event = client.sendEvent({
name: "test.job",
});
// Some time later...
const res = await client.cancelRunsForEvent(event.id);
console.log(res.cancelledRunIds);
console.log(res.failedToCancelRunIds);
Parameters
eventId
string
requiredThe event ID to cancel the job runs for. This is returned when calling either client.sendEvent() or io.sendEvent().
Returns
cancelledRunIds
array
requiredList of Job Run IDs that are cancelled.
failedToCancelRunIds
array
requiredList of Job Run IDs that have failed to be cancelled.
Was this page helpful?
const event = client.sendEvent({
name: "test.job",
});
// Some time later...
const res = await client.cancelRunsForEvent(event.id);
console.log(res.cancelledRunIds);
console.log(res.failedToCancelRunIds);