All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spice.maintenance.TaskStatus.scala Maven / Gradle / Ivy

There is a newer version: 0.7.2
Show newest version
package spice.maintenance

import scala.concurrent.duration.FiniteDuration

case class TaskStatus(lastRun: Option[Long] = None,
                      timesRun: Int = 0,
                      nextRun: Option[Long] = None,
                      nextSchedule: Option[FiniteDuration] = None) {
  def schedule(duration: FiniteDuration): TaskStatus = copy(
    nextRun = Some(System.currentTimeMillis() + duration.toMillis),
    nextSchedule = Some(duration)
  )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy