diff --git a/core/server/index.js b/core/server/index.js index 9e3fe6431b..660c413a20 100644 --- a/core/server/index.js +++ b/core/server/index.js @@ -78,12 +78,14 @@ function initializeRecurringJobs() { const jobsService = require('./services/jobs'); - jobsService.scheduleJob( - 'every 1 minute', - path.resolve(__dirname, 'services', 'email-analytics', 'jobs', 'fetch-latest.js'), - undefined, - 'email-analytics-fetch-latest' - ); + if (config.get('backgroundJobs:emailAnalytics')) { + jobsService.scheduleJob( + 'every 1 minute', + path.resolve(__dirname, 'services', 'email-analytics', 'jobs', 'fetch-latest.js'), + undefined, + 'email-analytics-fetch-latest' + ); + } } /** diff --git a/core/shared/config/defaults.json b/core/shared/config/defaults.json index 218008f082..1d60aca412 100644 --- a/core/shared/config/defaults.json +++ b/core/shared/config/defaults.json @@ -115,5 +115,8 @@ "adminFrameProtection": true, "sendWelcomeEmail": true, "stripeDirect": false, - "enableStripePromoCodes": false + "enableStripePromoCodes": false, + "backgroundJobs": { + "emailAnalytics": true + } }