start most cron jobs only after activation
Importing the db might take some time. If a cron runs in the middle,
it crashes.
TypeError: Cannot read property 'domain' of undefined
at Object.fqdn (/home/yellowtent/box/src/domains.js:126:111)
at /home/yellowtent/box/src/apps.js:460:36
at /home/yellowtent/box/node_modules/async/dist/async.js:3110:16
at replenish (/home/yellowtent/box/node_modules/async/dist/async.js:1011:17)
at /home/yellowtent/box/node_modules/async/dist/async.js:1016:9
at eachLimit$1 (/home/yellowtent/box/node_modules/async/dist/async.js:3196:24)
at Object.<anonymous> (/home/yellowtent/box/node_modules/async/dist/async.js:1046:16)
at /home/yellowtent/box/src/apps.js:458:19
at /home/yellowtent/box/src/appdb.js:232:13
at Query.args.(anonymous function) [as _callback] (/home/yellowtent/box/src/database.js
This commit is contained in:
@@ -74,7 +74,7 @@ function initialize(callback) {
|
||||
async.series([
|
||||
settings.initialize,
|
||||
reverseProxy.configureDefaultServer,
|
||||
cron.initialize, // required for caas heartbeat before activation
|
||||
cron.startPreActivationJobs,
|
||||
onActivated
|
||||
], callback);
|
||||
}
|
||||
@@ -83,7 +83,7 @@ function uninitialize(callback) {
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
async.series([
|
||||
cron.uninitialize,
|
||||
cron.stopJobs,
|
||||
platform.stop,
|
||||
settings.uninitialize
|
||||
], callback);
|
||||
@@ -99,7 +99,10 @@ function onActivated(callback) {
|
||||
if (error) return callback(new CloudronError(CloudronError.INTERNAL_ERROR, error));
|
||||
if (!count) return callback(); // not activated
|
||||
|
||||
platform.start(callback);
|
||||
async.series([
|
||||
platform.start,
|
||||
cron.startPostActivationJobs
|
||||
], callback);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user