From c213eb2f317c3e72601cb8bfb5f105024fa358ee Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sat, 12 Jul 2014 18:39:48 -0700 Subject: [PATCH] Minor fix --- lib/channel/mediarefresher.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/channel/mediarefresher.js b/lib/channel/mediarefresher.js index b5759a61..c677fa69 100644 --- a/lib/channel/mediarefresher.js +++ b/lib/channel/mediarefresher.js @@ -52,6 +52,10 @@ MediaRefresherModule.prototype.initVimeo = function (data, cb) { var self = this; self.channel.activeLock.lock(); InfoGetter.vimeoWorkaround(data.id, function (hack) { + if (self.dead || self.channel.dead) { + return; + } + if (self._media === data) { self.channel.logger.log("[mediarefresher] Refreshed vimeo video with ID " + data.id); @@ -72,15 +76,23 @@ MediaRefresherModule.prototype.refreshGoogleDocs = function (media, cb) { self.channel.activeLock.lock(); InfoGetter.getMedia(media.id, "gd", function (err, data) { + if (self.dead || self.channel.dead) { + return; + } + switch (err) { case "HTTP 302": case "Video not found": case "Private video": + self.channel.logger.log("[mediarefresher] Google Docs refresh failed: " + + err); self.channel.activeLock.release(); if (cb) cb(); return; default: if (err) { + self.channel.logger.log("[mediarefresher] Google Docs refresh failed: " + + err); Logger.errlog.log("Google Docs refresh failed for ID " + media.id + ": " + err); self.channel.activeLock.release();