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:
कारतोफ्फेलस्क्रिप्ट™
2023-01-04 11:38:48 +01:00
committed by GitHub
parent b67f803cbe
commit 8b19fdd5f0
25 changed files with 882 additions and 1324 deletions

View File

@@ -6,13 +6,11 @@ import * as testDb from './shared/testDb';
import type { AuthAgent } from './shared/types';
import * as utils from './shared/utils';
import { ILicensePostResponse, ILicenseReadResponse } from '@/Interfaces';
import { LicenseManager } from '@n8n_io/license-sdk';
import { License } from '@/License';
const MOCK_SERVER_URL = 'https://server.com/v1';
const MOCK_RENEW_OFFSET = 259200;
const MOCK_INSTANCE_ID = 'instance-id';
const MOCK_N8N_VERSION = '0.27.0';
let app: express.Application;
let testDbName = '';
@@ -41,7 +39,7 @@ beforeAll(async () => {
beforeEach(async () => {
license = new License();
await license.init(MOCK_INSTANCE_ID, MOCK_N8N_VERSION);
await license.init(MOCK_INSTANCE_ID);
});
afterEach(async () => {