refactor(core): Port event bus config (no-changelog) (#10111)

This commit is contained in:
Iván Ovejero
2024-07-19 13:25:44 +02:00
committed by GitHub
parent aba1c64500
commit 9ab29f2181
6 changed files with 51 additions and 64 deletions

View File

@@ -0,0 +1,31 @@
import { Config, Env, Nested } from '../decorators';
@Config
class LogWriterConfig {
/** Number of event log files to keep */
@Env('N8N_EVENTBUS_LOGWRITER_KEEPLOGCOUNT')
readonly keepLogCount: number = 3;
/** Max size (in KB) of an event log file before a new one is started */
@Env('N8N_EVENTBUS_LOGWRITER_MAXFILESIZEINKB')
readonly maxFileSizeInKB: number = 10240; // 10 MB
/** Basename of event log file */
@Env('N8N_EVENTBUS_LOGWRITER_LOGBASENAME')
readonly logBaseName: string = 'n8nEventLog';
}
@Config
export class EventBusConfig {
/** How often (in ms) to check for unsent event messages. Can in rare cases cause a message to be sent twice. `0` to disable */
@Env('N8N_EVENTBUS_CHECKUNSENTINTERVAL')
readonly checkUnsentInterval: number = 0;
/** Endpoint to retrieve n8n version information from */
@Nested
readonly logWriter: LogWriterConfig;
/** Whether to recover execution details after a crash or only mark status executions as crashed. */
@Env('N8N_EVENTBUS_RECOVERY_MODE')
readonly crashRecoveryMode: 'simple' | 'extensive' = 'extensive';
}

View File

@@ -6,6 +6,7 @@ import { VersionNotificationsConfig } from './configs/version-notifications';
import { PublicApiConfig } from './configs/public-api';
import { ExternalSecretsConfig } from './configs/external-secrets';
import { TemplatesConfig } from './configs/templates';
import { EventBusConfig } from './configs/event-bus';
@Config
class UserManagementConfig {
@@ -35,4 +36,7 @@ export class GlobalConfig {
@Nested
templates: TemplatesConfig;
@Nested
eventBus: EventBusConfig;
}