mirror of https://github.com/calzoneman/sync.git
Use Promise.reduce() on shutdown to prevent overloading memory
This commit is contained in:
parent
594a9e17da
commit
0a94da4d13
|
@ -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 => {
|
||||||
|
|
Loading…
Reference in New Issue