add CronDateTimeSchedulerTz variant in CollectionKronScheduler

This commit is contained in:
InsanusMokrassar 2021-04-10 00:33:05 +06:00
parent 5844859369
commit 5c81eede9c

View File

@ -39,6 +39,18 @@ data class CollectionKronScheduler internal constructor(
mergeCronDateTimeSchedulers(resultCronDateTimes)
)
}
is CronDateTimeSchedulerTz -> {
val newCronDateTimes = kronScheduler.cronDateTimes.toMutableList()
val cronDateTimes = schedulers.removeAll {
if (it is CronDateTimeSchedulerTz && it.offset == kronScheduler.offset) {
newCronDateTimes.addAll(it.cronDateTimes)
true
} else {
false
}
}
schedulers.add(CronDateTimeSchedulerTz(newCronDateTimes.toList(), kronScheduler.offset))
}
is CollectionKronScheduler -> kronScheduler.schedulers.forEach {
include(it)
}