mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
refactor(core): Delete dead code in ExternalHooks (no-changelog) (#10100)
This commit is contained in:
parent
1b6c2d3a37
commit
7a135df768
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue