mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +03:00
bbbd011074
- Bottom line - we need to manage shutting down gracefully when doing long-running tasks - To achieve that, we're going to use job queues In this commit: - added new @tryghost/job-manager dependency - added a minimal job service, that handles in passing things like logging and (maybe later) config - job service is wired up to server shutdown, so that the queue finishes before the server exits - also added a new job endpoint to testmode so that it's easy to test job behaviour without needing to do real work
12 lines
303 B
JavaScript
12 lines
303 B
JavaScript
/**
|
|
* Minimal wrapper around our external lib
|
|
* Intended for passing any Ghost internals such as logging and config
|
|
*/
|
|
|
|
const JobManager = require('@tryghost/job-manager');
|
|
const logging = require('../../../shared/logging');
|
|
|
|
const jobManager = new JobManager(logging);
|
|
|
|
module.exports = jobManager;
|