mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor: Delete a lot of unused and duplicate code in Server and WebhookServer (#5080)
* store n8n version string in a const and use that everywhere * reduce code duplication between Server and WebhookServer * unify redis checks * fix linting
This commit is contained in:
committed by
GitHub
parent
b67f803cbe
commit
8b19fdd5f0
@@ -5,15 +5,14 @@ import { MessageEventBusDestination } from './MessageEventBusDestination.ee';
|
||||
import * as Sentry from '@sentry/node';
|
||||
import { eventBus } from '../MessageEventBus/MessageEventBus';
|
||||
import {
|
||||
LoggerProxy,
|
||||
MessageEventBusDestinationOptions,
|
||||
MessageEventBusDestinationSentryOptions,
|
||||
MessageEventBusDestinationTypeNames,
|
||||
} from 'n8n-workflow';
|
||||
import { GenericHelpers } from '../..';
|
||||
import { isLogStreamingEnabled } from '../MessageEventBus/MessageEventBusHelper';
|
||||
import { EventMessageTypes } from '../EventMessageClasses';
|
||||
import { eventMessageGenericDestinationTestEvent } from '../EventMessageClasses/EventMessageGeneric';
|
||||
import { N8N_VERSION } from '@/constants';
|
||||
|
||||
export const isMessageEventBusDestinationSentryOptions = (
|
||||
candidate: unknown,
|
||||
@@ -45,22 +44,15 @@ export class MessageEventBusDestinationSentry
|
||||
if (options.tracesSampleRate) this.tracesSampleRate = options.tracesSampleRate;
|
||||
const { ENVIRONMENT: environment } = process.env;
|
||||
|
||||
GenericHelpers.getVersions()
|
||||
.then((versions) => {
|
||||
this.sentryClient = new Sentry.NodeClient({
|
||||
dsn: this.dsn,
|
||||
tracesSampleRate: this.tracesSampleRate,
|
||||
environment,
|
||||
release: versions.cli,
|
||||
transport: Sentry.makeNodeTransport,
|
||||
integrations: Sentry.defaultIntegrations,
|
||||
stackParser: Sentry.defaultStackParser,
|
||||
});
|
||||
LoggerProxy.debug(`MessageEventBusDestinationSentry with id ${this.getId()} initialized`);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
this.sentryClient = new Sentry.NodeClient({
|
||||
dsn: this.dsn,
|
||||
tracesSampleRate: this.tracesSampleRate,
|
||||
environment,
|
||||
release: N8N_VERSION,
|
||||
transport: Sentry.makeNodeTransport,
|
||||
integrations: Sentry.defaultIntegrations,
|
||||
stackParser: Sentry.defaultStackParser,
|
||||
});
|
||||
}
|
||||
|
||||
async receiveFromEventBus(msg: EventMessageTypes): Promise<boolean> {
|
||||
|
||||
Reference in New Issue
Block a user