Skip to content

Commit

Permalink
patch: move load() to init{}
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenSrcerer committed Apr 7, 2024
1 parent f1bb9fa commit 6e333cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ open class Schedule {
Remember to update the last execution when finishing.
*/
fun load() {
init {
cron = if (!isSingle()) cronParser.parse(periodic)
else null
nextExecution = nextExecution ?: nextExecution()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ScheduleRepository(
fun get(id: Long): Schedule? {
return with(factory.openSession()) {
this.load(Schedule::class.java, id, SCHEDULE_LOAD_DEPTH)
}?.also { it.load() }
}
}

fun getAll(): Collection<Schedule> {
Expand Down

0 comments on commit 6e333cb

Please sign in to comment.