mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
feat(core): Make executions pruning interval configurable (#7439)
This commit is contained in:
@@ -305,7 +305,7 @@ export const schema = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// To not exceed the database's capacity and keep its size moderate
|
// To not exceed the database's capacity and keep its size moderate
|
||||||
// the execution data gets pruned regularly (default: 1 hour interval).
|
// the execution data gets pruned regularly (default: 15 minute interval).
|
||||||
// All saved execution data older than the max age will be deleted.
|
// All saved execution data older than the max age will be deleted.
|
||||||
// Pruning is currently not activated by default, which will change in
|
// Pruning is currently not activated by default, which will change in
|
||||||
// a future version.
|
// a future version.
|
||||||
@@ -321,6 +321,12 @@ export const schema = {
|
|||||||
default: 336,
|
default: 336,
|
||||||
env: 'EXECUTIONS_DATA_MAX_AGE',
|
env: 'EXECUTIONS_DATA_MAX_AGE',
|
||||||
},
|
},
|
||||||
|
pruneDataInterval: {
|
||||||
|
doc: 'How often (minutes) execution data should be hard-deleted',
|
||||||
|
format: Number,
|
||||||
|
default: 15,
|
||||||
|
env: 'EXECUTIONS_DATA_PRUNE_INTERVAL',
|
||||||
|
},
|
||||||
|
|
||||||
// Additional pruning option to delete executions if total count exceeds the configured max.
|
// Additional pruning option to delete executions if total count exceeds the configured max.
|
||||||
// Deletes the oldest entries first
|
// Deletes the oldest entries first
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
|
|||||||
|
|
||||||
private rates: Record<string, number> = {
|
private rates: Record<string, number> = {
|
||||||
softDeletion: 1 * TIME.HOUR,
|
softDeletion: 1 * TIME.HOUR,
|
||||||
hardDeletion: 15 * TIME.MINUTE,
|
hardDeletion: config.getEnv('executions.pruneDataInterval') * TIME.MINUTE,
|
||||||
};
|
};
|
||||||
|
|
||||||
private isMainInstance = config.get('generic.instanceType') === 'main';
|
private isMainInstance = config.get('generic.instanceType') === 'main';
|
||||||
|
|||||||
Reference in New Issue
Block a user