🐛 Fixed webhook initialization when over limit

refs https://github.com/TryGhost/Team/issues/599

- Webhook listener was still kicking in when the limit for  "customIntegrations" was in place. This is due to parallel initialization that was done previously and sometimes limit service initialized before webhooks but sometimes it didn't!
- Moving it to be initialized before any othe service ensures the race conditon doesnt happen anymore
This commit is contained in:
Naz 2021-05-11 18:11:09 +04:00
parent 9c2388e8aa
commit 1e20f2cb76

View File

@ -157,6 +157,10 @@ async function initServices({config}) {
const urlUtils = require('./shared/url-utils');
// NOTE: limits service has to be initialized first
// in case it limits initialization of any other service (e.g. webhooks)
await limits.init();
await Promise.all([
permissions.init(),
xmlrpc.listen(),
@ -164,7 +168,6 @@ async function initServices({config}) {
mega.listen(),
webhooks.listen(),
appService.init(),
limits.init(),
scheduling.init({
apiUrl: urlUtils.urlFor('api', {version: defaultApiVersion, versionType: 'admin'}, true)
})