From b2f42cdce83e7dcc9e36b98a3a4d12be35077ec2 Mon Sep 17 00:00:00 2001 From: Greg Lange Date: Thu, 21 Apr 2011 15:18:34 +0000 Subject: [PATCH] got rid of use of set to keep track of obj hashes --- swift/obj/updater.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swift/obj/updater.py b/swift/obj/updater.py index c9d8c0ee66..ed7e398309 100644 --- a/swift/obj/updater.py +++ b/swift/obj/updater.py @@ -132,23 +132,23 @@ class ObjectUpdater(Daemon): prefix_path = os.path.join(async_pending, prefix) if not os.path.isdir(prefix_path): continue - seen = set() + last_obj_hash = None for update in sorted(os.listdir(prefix_path), reverse=True): update_path = os.path.join(prefix_path, update) if not os.path.isfile(update_path): continue try: - hash, timestamp = update.split('-') + obj_hash, timestamp = update.split('-') except ValueError: self.logger.error( _('ERROR async pending file with unexpected name %s') % (update_path)) continue - if hash in seen: + if obj_hash == last_obj_hash: os.unlink(update_path) else: self.process_object_update(update_path, device) - seen.add(hash) + last_obj_hash = obj_hash time.sleep(self.slowdown) try: os.rmdir(prefix_path)