sync-rsync: don't hold feed lock while waiting on new threads
authorJack Miller <jack@codezen.org>
Fri, 17 Jul 2015 02:22:52 +0000 (21:22 -0500)
committerJack Miller <jack@codezen.org>
Fri, 17 Jul 2015 02:22:52 +0000 (21:22 -0500)
plugins/sync-rsync.py

index 27e7535..f968217 100644 (file)
@@ -1,6 +1,6 @@
 # Canto rsync Plugin
 # by Jack Miller
-# v1.0
+# v1.1
 
 # This implements a lightweight remote sync based around rsync to a remote
 # server, or copying to mounted filesystem, etc.
@@ -260,15 +260,15 @@ class CantoFileSync(DaemonBackendPlugin):
                 for feed in sorted(allfeeds.feeds.keys()):
                     allfeeds.feeds[feed].lock.release_write()
 
+                # Complete wunlock_all()
+                feed_lock.release_write()
+
                 # Force feeds to be repopulated from disk, which will handle
                 # communicating changes to connections
 
                 self.backend.fetch.fetch(True, True)
                 self.backend.fetch.reap(True)
 
-                # Complete wunlock_all()
-                feed_lock.release_write()
-
             # Equal, just clear it up
 
             elif diff == 0: