]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
WIP
authorDavid Stainton <dstainton415@gmail.com>
Tue, 21 Apr 2015 21:51:51 +0000 (22:51 +0100)
committerDavid Stainton <dstainton415@gmail.com>
Tue, 21 Apr 2015 21:51:51 +0000 (22:51 +0100)
src/allmydata/frontends/drop_upload.py
src/allmydata/test/test_drop_upload.py

index 1d3387589b06d8ce6f4cbf1c18fbae0f9e4f524e..f84cf05b33a2c222b68c4bbbdab8483765749ce0 100644 (file)
@@ -89,9 +89,11 @@ class DropUploader(service.MultiService):
     def _check_db_file(self, childpath):
         # returns True if the file must be uploaded.
         assert self._db != None
-        use_timestamps = True
-        r = self._db.check_file(childpath, use_timestamps)
-        return not r.was_uploaded()
+        r = self._db.check_file(childpath)
+        filecap = r.was_uploaded()
+        print "uploaded filecap %s" % (filecap,)
+        if filecap is False:
+            return True
 
     def _scan(self, localpath):
         print "_scan"
@@ -119,12 +121,12 @@ class DropUploader(service.MultiService):
                 print "isdir"
                 # recurse on the child directory
                 self._scan(childpath)
-                must_upload = self._check_db_file(childpath)
+                must_upload = self._check_db_file(childpath.decode('UTF-8'))
                 if must_upload:
                     self._append_to_deque(childpath)
             elif isfile:
                 print "isfile %s" % (childpath,)
-                must_upload = self._check_db_file(childpath)
+                must_upload = self._check_db_file(childpath.decode('UTF-8'))
                 if must_upload:
                     print "must_upload"
                     self._append_to_deque(childpath)
index 825f515c0d28fa415f5915fc4f4954a5e9dc5af2..612b8ac414b5968df5cf0bbcb4c4511aa1d9f27a 100644 (file)
@@ -161,8 +161,9 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA
             print "stopped and removed uploader service."
         d.addCallback(msg)
         d.addCallback(self._made_upload_dir)
-        d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.objects_queued'), 0))
+        d.addCallback(lambda ign: time.sleep(3))
         d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.objects_uploaded'), 1))
+        d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.objects_queued'), 0))
         d.addBoth(self._cleanup)
         return d