Fix sleep calculation in `worker_impl`