https://kotlinlang.org logo
Title
s

Satyam Agarwal

01/30/2023, 10:49 AM
I am trying to use
Schedule
to run a job daily on a specific time forever. Can someone help me with an example ? I am a bit confused with the apis. I have used forever spaced jobs by using
Schedule.spaced<Unit>(duration).repeat { myjob() }
. But not able to add invoke on a specific time.
w

Wesley Hartford

01/30/2023, 4:07 PM
I don't believe that the
Schedule
includes features for specific time of day, though I'm not sure. I've only used it a little and didn't run across anything related to wall clock time.
s

Satyam Agarwal

01/30/2023, 5:24 PM
Thats what I am seeing too.
k

Kristian Nedrevold

01/30/2023, 6:09 PM
I've used https://github.com/jmrozanec/cron-utils to build this using coroutines