Saren says to YSITD while True: tasks = select * from tasks where run = false and schedule_ts >= Date.now() for t in tasks: run(t) sleep(1)