refactor(core): Refactor WorkflowStatistics code (no-changelog) (#6617)

refactor(core): Refactor WorkflowStatistics code
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-07-18 11:28:24 +02:00
committed by GitHub
parent e7091d6726
commit f4a18ba87d
20 changed files with 432 additions and 571 deletions

View File

@@ -97,10 +97,10 @@ import {
TagsController,
TranslationController,
UsersController,
WorkflowStatisticsController,
} from '@/controllers';
import { executionsController } from '@/executions/executions.controller';
import { workflowStatsController } from '@/api/workflowStats.api';
import { isApiEnabled, loadPublicApiVersions } from '@/PublicApi';
import {
getInstanceBaseUrl,
@@ -136,7 +136,6 @@ import { isLogStreamingEnabled } from '@/eventbus/MessageEventBus/MessageEventBu
import { licenseController } from './license/license.controller';
import { Push, setupPushServer, setupPushHandler } from '@/push';
import { setupAuthMiddlewares } from './middlewares';
import { initEvents } from './events';
import {
getLdapLoginLabel,
handleLdapInit,
@@ -383,9 +382,6 @@ export class Server extends AbstractServer {
saml_enabled: isSamlCurrentAuthenticationMethod(),
};
// Set up event handling
initEvents();
if (inDevelopment && process.env.N8N_DEV_RELOAD === 'true') {
const { reloadNodesAndCredentials } = await import('@/ReloadNodesAndCredentials');
await reloadNodesAndCredentials(this.loadNodesAndCredentials, this.nodeTypes, this.push);
@@ -496,6 +492,7 @@ export class Server extends AbstractServer {
}),
Container.get(SamlController),
Container.get(SourceControlController),
Container.get(WorkflowStatisticsController),
];
if (isLdapEnabled()) {
@@ -604,11 +601,6 @@ export class Server extends AbstractServer {
// ----------------------------------------
this.app.use(`/${this.restEndpoint}/license`, licenseController);
// ----------------------------------------
// Workflow Statistics
// ----------------------------------------
this.app.use(`/${this.restEndpoint}/workflow-stats`, workflowStatsController);
// ----------------------------------------
// SAML
// ----------------------------------------