mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Display log when application has really restarted
This commit is contained in:
parent
5d7eda0f14
commit
aef83536f1
@ -142,6 +142,9 @@ module.exports = function (strapi) {
|
||||
// zero downtime reloads.
|
||||
if (_.isPlainObject(strapi.config.reload) && !_.isEmpty(strapi.config.reload) && strapi.config.reload.workers > 0) {
|
||||
herd(strapi.config.name)
|
||||
.close(function () {
|
||||
process.send('message');
|
||||
})
|
||||
.timeout(strapi.config.reload.timeout)
|
||||
.size(strapi.config.reload.workers)
|
||||
.run(function () {
|
||||
|
||||
@ -57,6 +57,9 @@ module.exports = function (cb) {
|
||||
// (might be used by some hooks).
|
||||
self.reloading = true;
|
||||
|
||||
self.log.warn('Application is restarting...');
|
||||
console.log();
|
||||
|
||||
// Teardown Waterline adapters and
|
||||
// reload the Waterline ORM.
|
||||
self.after('hook:waterline:reloaded', function () {
|
||||
@ -75,15 +78,22 @@ module.exports = function (cb) {
|
||||
self.log.warn('You still need to restart your server to fully enjoy changes...');
|
||||
}
|
||||
|
||||
self.once('restart:done', function () {
|
||||
strapi.log.info('Application successfully restarted');
|
||||
});
|
||||
|
||||
if (cluster.isMaster) {
|
||||
_.forEach(cluster.workers, function (worker) {
|
||||
worker.on('message', function () {
|
||||
self.emit('restart:done');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Kill every worker processes.
|
||||
_.forEach(cluster.workers, function () {
|
||||
process.kill(process.pid, 'SIGHUP');
|
||||
});
|
||||
|
||||
if (cluster.isMaster && _.isPlainObject(strapi.config.reload) && !_.isEmpty(strapi.config.reload) && strapi.config.reload.workers > 0) {
|
||||
self.log.info('Application restarted');
|
||||
console.log();
|
||||
}
|
||||
});
|
||||
|
||||
// Reloading the router.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user