mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
feat(core): Make executions pruning interval configurable (#7439)
This commit is contained in:
parent
79f23fb939
commit
40707fa692
|
@ -305,7 +305,7 @@ export const schema = {
|
|||
},
|
||||
|
||||
// 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.
|
||||
// Pruning is currently not activated by default, which will change in
|
||||
// a future version.
|
||||
|
@ -321,6 +321,12 @@ export const schema = {
|
|||
default: 336,
|
||||
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.
|
||||
// Deletes the oldest entries first
|
||||
|
|
|
@ -88,7 +88,7 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
|
|||
|
||||
private rates: Record<string, number> = {
|
||||
softDeletion: 1 * TIME.HOUR,
|
||||
hardDeletion: 15 * TIME.MINUTE,
|
||||
hardDeletion: config.getEnv('executions.pruneDataInterval') * TIME.MINUTE,
|
||||
};
|
||||
|
||||
private isMainInstance = config.get('generic.instanceType') === 'main';
|
||||
|
|
Loading…
Reference in a new issue