Skip to content

Commit

Permalink
feat: Support finalize hook, triggered on command finalization
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Sep 16, 2021
1 parent 7663b19 commit cb4f08a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/classes/PluginManager.js
Expand Up @@ -660,6 +660,13 @@ class PluginManager {
}
}

try {
for (const { hook } of this.getHooks(['finalize'])) await hook();
} catch (finalizeHookException) {
await deferredBackendNotificationRequest;
throw finalizeHookException;
}

if (deferredBackendNotificationRequest) {
await processBackendNotificationRequest(await deferredBackendNotificationRequest);
}
Expand Down

0 comments on commit cb4f08a

Please sign in to comment.