refactor(core): Port cache config (no-changelog) (#10286)

This commit is contained in:
Iván Ovejero
2024-08-02 17:10:03 +02:00
committed by GitHub
parent aa0a470dce
commit acbae928f2
20 changed files with 190 additions and 162 deletions

View File

@@ -1,8 +1,13 @@
import { ActivationErrorsService } from '@/ActivationErrors.service';
import { CacheService } from '@/services/cache/cache.service';
import { GlobalConfig } from '@n8n/config';
import { mockInstance } from '@test/mocking';
describe('ActivationErrorsService', () => {
const cacheService = new CacheService();
const globalConfig = mockInstance(GlobalConfig, {
cache: { backend: 'memory', memory: { maxSize: 3 * 1024 * 1024, ttl: 3600 * 1000 } },
});
const cacheService = new CacheService(globalConfig);
const activationErrorsService = new ActivationErrorsService(cacheService);
const firstWorkflowId = 'GSG0etbfTA2CNPDX';

View File

@@ -12,8 +12,8 @@ jest.unmock('@/eventbus/MessageEventBus/MessageEventBus');
const toLines = (response: Response) => response.text.trim().split('\n');
const globalConfig = Container.get(GlobalConfig);
// @ts-expect-error `metrics` is a readonly property
globalConfig.endpoints.metrics = {
enable: true,
prefix: 'n8n_test_',
includeDefaultMetrics: true,
includeApiEndpoints: true,