Crash fix
This commit is contained in:
parent
0102b92730
commit
8152008466
|
@ -1039,6 +1039,7 @@ PlaylistModule.prototype.startPlayback = function (time) {
|
|||
if (media.type === "gd") {
|
||||
this._gdRefreshTimer = setInterval(this.refreshGoogleDocs.bind(this), 3600000);
|
||||
if (media.meta.expiration && media.meta.expiration < Date.now() + 3600000) {
|
||||
var self = this;
|
||||
setTimeout(this.refreshGoogleDocs.bind(this), media.meta.expiration - Date.now());
|
||||
}
|
||||
}
|
||||
|
@ -1086,6 +1087,11 @@ PlaylistModule.prototype._leadLoop = function() {
|
|||
|
||||
PlaylistModule.prototype.refreshGoogleDocs = function (cb) {
|
||||
var self = this;
|
||||
|
||||
if (self.dead || !self.channel || self.channel.dead) {
|
||||
return;
|
||||
}
|
||||
|
||||
var abort = function () {
|
||||
clearInterval(self._gdRefreshTimer);
|
||||
self._gdRefreshTimer = false;
|
||||
|
@ -1111,7 +1117,9 @@ PlaylistModule.prototype.refreshGoogleDocs = function (cb) {
|
|||
self.current.media.meta.object = self.current.media.meta.object || null;
|
||||
self.current.media.meta.failed = true;
|
||||
}
|
||||
cb && cb();
|
||||
if (cb) {
|
||||
cb();
|
||||
}
|
||||
self.channel.activeLock.release();
|
||||
} else {
|
||||
if (!self.current || self.current.media.type !== "gd") {
|
||||
|
|
|
@ -27,7 +27,6 @@ var urlRetrieve = function (transport, options, callback) {
|
|||
Logger.errlog.log(err.stack);
|
||||
Logger.errlog.log("urlRetrieve failed: " + err);
|
||||
Logger.errlog.log("Request was: " + options.host + options.path);
|
||||
callback(503, err);
|
||||
});
|
||||
d.run(function () {
|
||||
var req = transport.request(options, function (res) {
|
||||
|
|
Loading…
Reference in a new issue