mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(core): Add metrics option to cache (#6846)
* add metrics to cache * use events for metrics * pr comments / broken test * lint fix * update the test * improve tests * Update packages/cli/src/config/schema.ts * disable flaky test * lint fix --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
fdfc6c5a92
commit
adcf5a96e8
@@ -0,0 +1,27 @@
|
||||
import { MessageEventBusDestinationTypeNames, LoggerProxy } from 'n8n-workflow';
|
||||
import type { EventDestinations } from '@/databases/entities/EventDestinations';
|
||||
import type { MessageEventBus } from '../MessageEventBus/MessageEventBus';
|
||||
import type { MessageEventBusDestination } from './MessageEventBusDestination.ee';
|
||||
import { MessageEventBusDestinationSentry } from './MessageEventBusDestinationSentry.ee';
|
||||
import { MessageEventBusDestinationSyslog } from './MessageEventBusDestinationSyslog.ee';
|
||||
import { MessageEventBusDestinationWebhook } from './MessageEventBusDestinationWebhook.ee';
|
||||
|
||||
export function messageEventBusDestinationFromDb(
|
||||
eventBusInstance: MessageEventBus,
|
||||
dbData: EventDestinations,
|
||||
): MessageEventBusDestination | null {
|
||||
const destinationData = dbData.destination;
|
||||
if ('__type' in destinationData) {
|
||||
switch (destinationData.__type) {
|
||||
case MessageEventBusDestinationTypeNames.sentry:
|
||||
return MessageEventBusDestinationSentry.deserialize(eventBusInstance, destinationData);
|
||||
case MessageEventBusDestinationTypeNames.syslog:
|
||||
return MessageEventBusDestinationSyslog.deserialize(eventBusInstance, destinationData);
|
||||
case MessageEventBusDestinationTypeNames.webhook:
|
||||
return MessageEventBusDestinationWebhook.deserialize(eventBusInstance, destinationData);
|
||||
default:
|
||||
LoggerProxy.debug('MessageEventBusDestination __type unknown');
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user