Added `rescheduleOnBoot` option for post scheduling (#9196)

no issue

- allows custom scheduling adapters with persistent data to not reschedule posts when Ghost is restarted
This commit is contained in:
David Wolfe 2017-11-07 23:24:34 +00:00 committed by Katharina Irrgang
parent 60fd98679f
commit f44a495cfc
2 changed files with 4 additions and 2 deletions

View File

@ -17,6 +17,7 @@ function SchedulingDefault(options) {
this.beforePingInMs = -50;
this.retryTimeoutInMs = 1000 * 5;
this.rescheduleOnBoot = true;
this.allJobs = {};
this.deletedJobs = {};
this.isRunning = false;

View File

@ -51,12 +51,13 @@ exports.init = function init(options) {
return _private.loadClient()
.then(function (_client) {
client = _client;
return localUtils.createAdapter(config);
})
.then(function (_adapter) {
adapter = _adapter;
if (!adapter.rescheduleOnBoot) {
return [];
}
return _private.loadScheduledPosts();
})
.then(function (scheduledPosts) {