1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-10-06 17:47:46 +03:00

refactor(core): Delete dead code in ExternalHooks (no-changelog) (#10100)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-07-18 17:18:58 +02:00 committed by GitHub
parent 1b6c2d3a37
commit 7a135df768
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,17 +42,7 @@ export class ExternalHooks {
this.initDidRun = true;
}
async reload(externalHooks?: IExternalHooksFileData) {
this.externalHooks = {};
if (externalHooks === undefined) {
await this.loadHooksFiles(true);
} else {
this.loadHooks(externalHooks);
}
}
async loadHooksFiles(reload = false) {
private async loadHooksFiles() {
const externalHookFiles = config.getEnv('externalHookFiles').split(':');
// Load all the provided hook-files
@ -60,10 +50,6 @@ export class ExternalHooks {
hookFilePath = hookFilePath.trim();
if (hookFilePath !== '') {
try {
if (reload) {
delete require.cache[require.resolve(hookFilePath)];
}
const hookFile = require(hookFilePath) as IExternalHooksFileData;
this.loadHooks(hookFile);
} catch (e) {
@ -78,7 +64,7 @@ export class ExternalHooks {
}
}
loadHooks(hookFileData: IExternalHooksFileData) {
private loadHooks(hookFileData: IExternalHooksFileData) {
for (const resource of Object.keys(hookFileData)) {
for (const operation of Object.keys(hookFileData[resource])) {
// Save all the hook functions directly under their string