feat: Workflow History pruning and prune time settings (#7343)

Github issue / Community forum post (link here to close automatically):
This commit is contained in:
Val
2023-10-04 13:57:21 +01:00
committed by GitHub
parent 6d3d1789db
commit 0adc533719
13 changed files with 401 additions and 2 deletions

View File

@@ -610,6 +610,22 @@ export async function createWorkflowHistoryItem(
});
}
export async function createManyWorkflowHistoryItems(
workflowId: string,
count: number,
time?: Date,
) {
const baseTime = (time ?? new Date()).valueOf();
return Promise.all(
[...Array(count)].map(async (_, i) =>
createWorkflowHistoryItem(workflowId, {
createdAt: new Date(baseTime + i),
updatedAt: new Date(baseTime + i),
}),
),
);
}
// ----------------------------------
// connection options
// ----------------------------------