feat(FN-5486): merge fusion/fn-5486
This commit is contained in:
@@ -3422,9 +3422,6 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
|
||||
const task = await this.createTaskWithDistributedReservation(input, {
|
||||
createTaskWithId: async (taskId) => {
|
||||
if (input.dependencies?.includes(taskId)) {
|
||||
throw new Error(`Task ${taskId} cannot depend on itself`);
|
||||
}
|
||||
await this.assertNoDependencyCycle(taskId, input.dependencies ?? [], "createTask");
|
||||
return this._createTaskInternal(
|
||||
input,
|
||||
@@ -3525,10 +3522,6 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
throw new Error("taskId is required");
|
||||
}
|
||||
|
||||
if (input.dependencies?.includes(id)) {
|
||||
throw new Error(`Task ${id} cannot depend on itself`);
|
||||
}
|
||||
|
||||
await this.assertNoDependencyCycle(id, input.dependencies ?? [], "createTaskWithReservedId");
|
||||
|
||||
this.assertTaskIdAvailable(id);
|
||||
@@ -5090,10 +5083,6 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
runContext?: RunMutationContext,
|
||||
): Promise<Task> {
|
||||
return this.withTaskLock(id, async () => {
|
||||
// Validate that task doesn't depend on itself
|
||||
if (updates.dependencies?.includes(id)) {
|
||||
throw new Error(`Task ${id} cannot depend on itself`);
|
||||
}
|
||||
if (updates.dependencies !== undefined) {
|
||||
await this.assertNoDependencyCycle(
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user