Skip to content

Commit 774b9e6

Browse files
committed
Try to fix cron
1 parent dc4033f commit 774b9e6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cron/src/main/scala/ox/scheduling/cron/CronSchedule.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import ox.scheduling.Schedule
66

77
import java.time.LocalDateTime
88
import java.time.temporal.ChronoUnit
9-
import java.util.concurrent.TimeUnit
10-
import scala.concurrent.duration.{Duration, FiniteDuration}
9+
import scala.concurrent.duration.*
1110

1211
/** Methods in this object provide [[Schedule]] based on supplied cron expression.
1312
*/
@@ -32,7 +31,8 @@ object CronSchedule:
3231
val now = LocalDateTime.now()
3332
val next = cron.next(now)
3433
val duration = next.map(n => ChronoUnit.MILLIS.between(now, n))
35-
duration.map(FiniteDuration.apply(_, TimeUnit.MILLISECONDS)).getOrElse(Duration.Zero)
34+
println("COMPUTED " + duration)
35+
duration.map(_.millis).getOrElse(Duration.Zero)
3636

3737
Schedule.computed((), _ => ((), computeNext))
3838
end fromCronExpr

0 commit comments

Comments
 (0)