mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat: Workflow History pruning and prune time settings (#7343)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -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
|
||||
// ----------------------------------
|
||||
|
||||
Reference in New Issue
Block a user