Stateless, fault-tolerant scheduling using randomness
tech.backtype.com
tech.backtype.com
Still, nice.
def deleting_thread():
while True:
# 10 minutes
time.sleep(10 * 60)
# pseudocode
if 01:00 <= time() and time() < 01:10:
deleteFromSolrAndOptimize()
And no I'm not creating an account to tell this guy so on his blog.If you don't care how often your function runs then why not just rely on the system clock and maintain a "lastrun"-variable?