From 407eaa8d90dc311ebc82f31dae00ae835e6fa6db Mon Sep 17 00:00:00 2001 From: David Stainton Date: Tue, 21 Apr 2015 22:51:51 +0100 Subject: [PATCH] WIP --- src/allmydata/frontends/drop_upload.py | 12 +++++++----- src/allmydata/test/test_drop_upload.py | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/allmydata/frontends/drop_upload.py b/src/allmydata/frontends/drop_upload.py index c2691d1e..a7958a48 100644 --- a/src/allmydata/frontends/drop_upload.py +++ b/src/allmydata/frontends/drop_upload.py @@ -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) diff --git a/src/allmydata/test/test_drop_upload.py b/src/allmydata/test/test_drop_upload.py index 98f56837..4399a9c8 100644 --- a/src/allmydata/test/test_drop_upload.py +++ b/src/allmydata/test/test_drop_upload.py @@ -162,8 +162,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 -- 2.45.2