e837500486
* Locked task runs will now require queues and tasks to be in the locked version * Client errors caught in a run function now will skip retrying * Extracted out the trigger queues logic * extract validation, idempotency keys, payloads to concerns * Extracted out a bunch of more stuff and getting trigger tests to work * Add queue and locked version tests * Deadlock detection WIP * more deadlock detection * Only detect deadlocks when the parent run is waiting on the child run * Improve the error experience around deadlocks * A couple tweaks to make CodeRabbit happy and fixing the tests in CI * Fixed failing test * Changeset * wip * Make sure to scope queries to the runtime env
15 lines
510 B
TypeScript
15 lines
510 B
TypeScript
import { autoIncrementCounter } from "~/services/autoIncrementCounter.server";
|
|
import { RunNumberIncrementer, TriggerTaskRequest } from "../types";
|
|
|
|
export class DefaultRunNumberIncrementer implements RunNumberIncrementer {
|
|
async incrementRunNumber<T>(
|
|
request: TriggerTaskRequest,
|
|
callback: (num: number) => Promise<T>
|
|
): Promise<T | undefined> {
|
|
return await autoIncrementCounter.incrementInTransaction(
|
|
`v3-run:${request.environment.id}:${request.taskId}`,
|
|
callback
|
|
);
|
|
}
|
|
}
|