refactor(core): Mark deprecations for v2 (#11817)

This commit is contained in:
Iván Ovejero
2024-11-22 13:49:00 +01:00
committed by GitHub
parent 5c80cb57cf
commit bce2366947
3 changed files with 131 additions and 23 deletions

View File

@@ -21,6 +21,7 @@ import { LICENSE_FEATURES, inDevelopment, inTest } from '@/constants';
import * as CrashJournal from '@/crash-journal';
import * as Db from '@/db';
import { getDataDeduplicationService } from '@/deduplication';
import { DeprecationService } from '@/deprecation/deprecation.service';
import { initErrorHandling } from '@/error-reporting';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
import { TelemetryEventRelay } from '@/events/relays/telemetry.event-relay';
@@ -88,33 +89,14 @@ export abstract class BaseCommand extends Command {
await this.exitWithCrash('There was an error running database migrations', error),
);
const { type: dbType } = this.globalConfig.database;
if (['mysqldb', 'mariadb'].includes(dbType)) {
this.logger.warn(
'Support for MySQL/MariaDB has been deprecated and will be removed with an upcoming version of n8n. Please migrate to PostgreSQL.',
);
}
if (process.env.N8N_SKIP_WEBHOOK_DEREGISTRATION_SHUTDOWN) {
this.logger.warn(
'The flag to skip webhook deregistration N8N_SKIP_WEBHOOK_DEREGISTRATION_SHUTDOWN has been removed. n8n no longer deregisters webhooks at startup and shutdown, in main and queue mode.',
);
}
if (config.getEnv('executions.mode') === 'queue' && dbType === 'sqlite') {
this.logger.warn(
'Queue mode is not officially supported with sqlite. Please switch to PostgreSQL.',
);
}
Container.get(DeprecationService).warn();
if (
process.env.N8N_BINARY_DATA_TTL ??
process.env.N8N_PERSISTED_BINARY_DATA_TTL ??
process.env.EXECUTIONS_DATA_PRUNE_TIMEOUT
config.getEnv('executions.mode') === 'queue' &&
this.globalConfig.database.type === 'sqlite'
) {
this.logger.warn(
'The env vars N8N_BINARY_DATA_TTL and N8N_PERSISTED_BINARY_DATA_TTL and EXECUTIONS_DATA_PRUNE_TIMEOUT no longer have any effect and can be safely removed. Instead of relying on a TTL system for binary data, n8n currently cleans up binary data together with executions during pruning.',
'Scaling mode is not officially supported with sqlite. Please use PostgreSQL instead.',
);
}