Skip to content

Commit

Permalink
feat(core): Make executions pruning interval configurable (#7439)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored Oct 18, 2023
1 parent 79f23fb commit 40707fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 40707fa

Please sign in to comment.