crawler: tolerate low-resolution system clocks (i.e. windows)

This commit is contained in:
Brian Warner 2009-02-21 00:15:33 -07:00
parent 106d31b112
commit b9c4f4bdf6

View File

@ -260,7 +260,7 @@ class ShareCrawler(service.MultiService):
buckets, start_slice)
self.last_complete_prefix_index = i
self.save_state()
if time.time() > start_slice + self.cpu_slice:
if time.time() >= start_slice + self.cpu_slice:
raise TimeSliceExceeded()
# yay! we finished the whole cycle
self.last_complete_prefix_index = -1
@ -287,7 +287,7 @@ class ShareCrawler(service.MultiService):
# time-consuming, but lets us avoid losing more than one bucket's
# worth of progress.
self.save_state()
if time.time() > start_slice + self.cpu_slice:
if time.time() >= start_slice + self.cpu_slice:
raise TimeSliceExceeded()
def process_bucket(self, cycle, prefix, prefixdir, storage_index_b32):