]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
WIP
authorDavid Stainton <dstainton415@gmail.com>
Fri, 15 Jan 2016 10:02:37 +0000 (10:02 +0000)
committerDavid Stainton <dstainton415@gmail.com>
Tue, 26 Jan 2016 15:27:20 +0000 (15:27 +0000)
src/allmydata/frontends/magic_folder.py
src/allmydata/test/test_magic_folder.py

index d25e9f743508f49a403488d728e51f7eedb45426..05bc4345fdc001af9f685b2cddf914d268b2c8b9 100644 (file)
@@ -156,27 +156,31 @@ class QueueMixin(HookMixin):
         #open("events", "ab+").write(msg)
 
     def _turn_deque(self):
-        self._log("_turn_deque")
-        if self._stopped:
-            self._log("stopped")
-            return
         try:
-            item = self._deque.pop()
-            self._log("popped %r" % (item,))
-            self._count('objects_queued', -1)
-        except IndexError:
-            self._log("deque is now empty")
-            self._lazy_tail.addCallback(lambda ign: self._when_queue_is_empty())
-        else:
-            print "_turn_deque else clause"
-            def whawhat(result):
-                print "result %r" % (result,)
-                return result
-            self._lazy_tail.addBoth(whawhat)
-            self._lazy_tail.addCallback(lambda ign: self._process(item))
-            self._lazy_tail.addBoth(self._call_hook, 'processed')
-            self._lazy_tail.addErrback(log.err)
-            self._lazy_tail.addCallback(lambda ign: task.deferLater(self._clock, self._turn_delay, self._turn_deque))
+            self._log("_turn_deque")
+            if self._stopped:
+                self._log("stopped")
+                return
+            try:
+                item = self._deque.pop()
+                self._log("popped %r" % (item,))
+                self._count('objects_queued', -1)
+            except IndexError:
+                self._log("deque is now empty")
+                self._lazy_tail.addCallback(lambda ign: self._when_queue_is_empty())
+            else:
+                self._log("_turn_deque else clause")
+                def whawhat(result):
+                    self._log("whawhat result %r" % (result,))
+                    return result
+                self._lazy_tail.addBoth(whawhat)
+                self._lazy_tail.addCallback(lambda ign: self._process(item))
+                self._lazy_tail.addBoth(self._call_hook, 'processed')
+                self._lazy_tail.addErrback(log.err)
+                self._lazy_tail.addCallback(lambda ign: task.deferLater(self._clock, self._turn_delay, self._turn_deque))
+        except Exception as e:
+            self._log("turn deque exception %s" % (e,))
+            raise
 
 
 class Uploader(QueueMixin):
@@ -333,6 +337,7 @@ class Uploader(QueueMixin):
         d = defer.succeed(None)
 
         def _maybe_upload(val, now=None):
+            self._log("_maybe_upload(%r, now=%r)" % (val, now))
             if now is None:
                 now = time.time()
             fp = self._get_filepath(relpath_u)
index 604d23a3c080acc88579db1a1e472e2bc63ea483..44bf25d17b8fd56da1e7dcf7d27a8263f4fc8714 100644 (file)
@@ -1188,7 +1188,7 @@ class MockTest(MagicFolderTestMixin, unittest.TestCase):
         # .tmp file shouldn't exist
         self.failIf(os.path.exists(local_file + u".tmp"))
 
-    def test_periodic_full_scan(self):
+    def meowmeow_test_periodic_full_scan(self):
         self.set_up_grid()
         self.local_dir = abspath_expanduser_unicode(u"test_periodic_full_scan",base=self.basedir)
         self.mkdir_nonascii(self.local_dir)