mirror of https://github.com/calzoneman/sync.git
Prevent server from infinite looping when google docs refresh fails
This commit is contained in:
parent
f3eb999a76
commit
3cae0b0e57
|
@ -940,7 +940,7 @@ PlaylistModule.prototype.startPlayback = function (time) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (media.type === "gd" && !media.meta.object) {
|
||||
if (media.type === "gd" && !media.meta.object && !media.meta.failed) {
|
||||
self.channel.activeLock.lock();
|
||||
this.refreshGoogleDocs(function () {
|
||||
self.channel.activeLock.release();
|
||||
|
@ -1039,6 +1039,7 @@ PlaylistModule.prototype.refreshGoogleDocs = function (cb) {
|
|||
self._gdRefreshTimer = false;
|
||||
if (self.current) {
|
||||
self.current.media.meta.object = self.current.media.meta.object || null;
|
||||
self.current.media.meta.failed = true;
|
||||
}
|
||||
if (cb) {
|
||||
cb();
|
||||
|
@ -1054,7 +1055,10 @@ PlaylistModule.prototype.refreshGoogleDocs = function (cb) {
|
|||
if (err) {
|
||||
Logger.errlog.log("Google Docs autorefresh failed: " + err);
|
||||
Logger.errlog.log("ID was: " + self.current.media.id);
|
||||
if (self.current) {
|
||||
self.current.media.meta.object = self.current.media.meta.object || null;
|
||||
self.current.media.meta.failed = true;
|
||||
}
|
||||
cb && cb();
|
||||
self.channel.activeLock.release();
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue