Don't run deferred fetch threads for dead feeds
authorJack Miller <jack@codezen.org>
Fri, 19 Jun 2015 16:51:21 +0000 (11:51 -0500)
committerJack Miller <jack@codezen.org>
Fri, 19 Jun 2015 16:51:21 +0000 (11:51 -0500)
canto_next/feed.py
canto_next/fetch.py

index 5f7a7bf..e35a00c 100644 (file)
@@ -443,5 +443,6 @@ class CantoFeed(PluginHandler):
         # Check for existence in case of delete quickly
         # after add.
 
+        self.stopped = True
         if self.URL in self.shelf:
             del self.shelf[self.URL]
index c2f6259..5fde678 100644 (file)
@@ -168,6 +168,12 @@ class CantoFetch():
         if len(self.threads) >= self.thread_limit:
             return False
 
+        # If feed is stopped/dead, pretend like we did the work but don't
+        # resurrect tags
+
+        if feed.stopped:
+            return True
+
         thread = CantoFetchThread(feed, fromdisk)
         thread.start()
         log.debug("Started thread for feed %s", feed)