spice.maintenance.TaskStatus.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spice-core_3 Show documentation
Show all versions of spice-core_3 Show documentation
Core functionality leveraged and shared by most other sub-projects of YouI.
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