mirror of https://github.com/calzoneman/sync.git
Fix incremental dumping of channels
This commit is contained in:
parent
5f41217595
commit
777d767466
|
@ -158,7 +158,7 @@ Channel.prototype.loadDump = function() {
|
||||||
this.css = data.css || "";
|
this.css = data.css || "";
|
||||||
this.js = data.js || "";
|
this.js = data.js || "";
|
||||||
this.sendAll("channelCSSJS", {css: this.css, js: this.js});
|
this.sendAll("channelCSSJS", {css: this.css, js: this.js});
|
||||||
setTimeout(function() { incrementalDump(this); }, 300000);
|
setTimeout(function() { incrementalDump(this); }.bind(this), 300000);
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
Logger.errlog.log("Channel dump load failed: ");
|
Logger.errlog.log("Channel dump load failed: ");
|
||||||
|
@ -193,6 +193,7 @@ Channel.prototype.saveDump = function() {
|
||||||
// Save channel dumps every 5 minutes, in case of crash
|
// Save channel dumps every 5 minutes, in case of crash
|
||||||
function incrementalDump(chan) {
|
function incrementalDump(chan) {
|
||||||
if(chan && chan.users && chan.users.length > 0) {
|
if(chan && chan.users && chan.users.length > 0) {
|
||||||
|
console.log("dumping " + chan.name);
|
||||||
chan.saveDump();
|
chan.saveDump();
|
||||||
setTimeout(function() { incrementalDump(chan); }, 300000);
|
setTimeout(function() { incrementalDump(chan); }, 300000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue