0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Fixed small boot time regression due to lack of dependency lazyloading

- when I extracted `mailgun-client` to a separate package, I
  accidentally removed the lazyloading for the `mailgun-js` library,
  which takes a non-negligible amount of time to require on boot
- this fixes that by moving the require into the function where it's
  used
This commit is contained in:
Daniel Lockyer 2022-08-15 10:10:26 +02:00
parent 7f5d95ffff
commit 2a07b94bd4
No known key found for this signature in database
GPG key ID: D21186F0B47295AD

View file

@ -1,7 +1,6 @@
const _ = require('lodash');
const debug = require('@tryghost/debug');
const logging = require('@tryghost/logging');
const mailgun = require('mailgun-js');
module.exports.BATCH_SIZE = 1000;
@ -187,6 +186,7 @@ module.exports = class MailgunClient {
return null;
}
const mailgun = require('mailgun-js');
const baseUrl = new URL(mailgunConfig.baseUrl);
return mailgun({