Use Promise.reduce() on shutdown to prevent overloading memory

This commit is contained in:
calzoneman 2016-05-25 18:56:10 -07:00
parent 594a9e17da
commit 0a94da4d13
1 changed files with 1 additions and 1 deletions

View File

@ -277,7 +277,7 @@ Server.prototype.announce = function (data) {
Server.prototype.shutdown = function () { Server.prototype.shutdown = function () {
Logger.syslog.log("Unloading channels"); Logger.syslog.log("Unloading channels");
Promise.map(this.channels, channel => { Promise.reduce(this.channels, (_, channel) => {
return channel.saveState().tap(() => { return channel.saveState().tap(() => {
Logger.syslog.log(`Saved /r/${channel.name}`); Logger.syslog.log(`Saved /r/${channel.name}`);
}).catch(err => { }).catch(err => {