mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Readded job scheduling to boot process
- This was missing from the new boot process! - Added it back because obviously it is necessary :D
This commit is contained in:
parent
4b472615a8
commit
71521d166e
17
core/boot.js
17
core/boot.js
@ -104,6 +104,21 @@ const initServices = async ({config}) => {
|
||||
debug('End: initialiseServices');
|
||||
};
|
||||
|
||||
async function initRecurringJobs({config}) {
|
||||
debug('Begin: initRecurringJobs');
|
||||
// we don't want to kick off scheduled/recurring jobs that will interfere with tests
|
||||
if (process.env.NODE_ENV.match(/^testing/)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.get('backgroundJobs:emailAnalytics')) {
|
||||
const emailAnalyticsJobs = require('./server/services/email-analytics/jobs');
|
||||
await emailAnalyticsJobs.scheduleRecurringJobs();
|
||||
}
|
||||
|
||||
debug('End: initRecurringJobs');
|
||||
}
|
||||
|
||||
const mountGhost = (rootApp, ghostApp) => {
|
||||
const urlService = require('./frontend/services/url');
|
||||
rootApp.disable('maintenance');
|
||||
@ -169,6 +184,8 @@ const bootGhost = async () => {
|
||||
debug('boot announcing readiness');
|
||||
GhostServer.announceServerReadiness();
|
||||
|
||||
// Init our background jobs, we don't wait for this to finish
|
||||
initRecurringJobs({config});
|
||||
// We return the server for testing purposes
|
||||
return ghostServer;
|
||||
} catch (error) {
|
||||
|
Loading…
Reference in New Issue
Block a user