refactor(core): Port concurrency config (#18324)

This commit is contained in:
Iván Ovejero
2025-08-15 10:47:11 +02:00
committed by GitHub
parent 2cbea86fec
commit 9cc1b11f7f
7 changed files with 71 additions and 51 deletions

View File

@@ -11,6 +11,21 @@ class PruningIntervalsConfig {
softDelete: number = 60;
}
@Config
class ConcurrencyConfig {
/**
* Max production executions allowed to run concurrently. `-1` means unlimited.
*
* Default for scaling mode is taken from the worker's `--concurrency` flag.
*/
@Env('N8N_CONCURRENCY_PRODUCTION_LIMIT')
productionLimit: number = -1;
/** Max evaluation executions allowed to run concurrently. `-1` means unlimited. */
@Env('N8N_CONCURRENCY_EVALUATION_LIMIT')
evaluationLimit: number = -1;
}
@Config
export class ExecutionsConfig {
/** Whether to delete past executions on a rolling basis. */
@@ -38,4 +53,7 @@ export class ExecutionsConfig {
@Nested
pruneDataIntervals: PruningIntervalsConfig;
@Nested
concurrency: ConcurrencyConfig;
}

View File

@@ -310,6 +310,10 @@ describe('GlobalConfig', () => {
hardDelete: 15,
softDelete: 60,
},
concurrency: {
productionLimit: -1,
evaluationLimit: -1,
},
},
diagnostics: {
enabled: true,