update libraries
* spring boot 2.5.5 -> 2.6.6 * kotlin 1.5.31 -> 1.6.20 * coroutines 1.5.2 -> 1.6.1 * gson 2.8.8 -> 2.9.0 * gradle wrapper 7.2 -> 7.4.2
This commit is contained in:
@ -38,7 +38,8 @@ import java.util.concurrent.Executors
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.collections.HashSet
|
||||
import kotlin.concurrent.scheduleAtFixedRate
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Duration.Companion.hours
|
||||
import kotlin.time.Duration.Companion.minutes
|
||||
import kotlin.time.ExperimentalTime
|
||||
|
||||
class CacheController {
|
||||
@ -72,7 +73,7 @@ class CacheController {
|
||||
val instr = CacheController::class.java.getResourceAsStream("/html/Timetable_normal-week.html")
|
||||
|
||||
val timetableParser =
|
||||
TimetableParser(htmlDoc = Jsoup.parse(instr, "UTF-8", "https://www.hs-offenburg.de/"))
|
||||
TimetableParser(htmlDoc = Jsoup.parse(instr!!, "UTF-8", "https://www.hs-offenburg.de/"))
|
||||
val timetableTest = timetableParser.parseTimeTable()
|
||||
|
||||
return TimetableCourseWeek(
|
||||
@ -256,10 +257,10 @@ class CacheController {
|
||||
private fun scheduledUpdates() {
|
||||
val currentTime = System.currentTimeMillis()
|
||||
|
||||
val duration24h = Duration.hours(24).inWholeMilliseconds
|
||||
val duration3h = Duration.hours(3).inWholeMilliseconds
|
||||
val duration1h = Duration.hours(1).inWholeMilliseconds
|
||||
val duration1m = Duration.minutes(1).inWholeMilliseconds
|
||||
val duration24h = 24.hours.inWholeMilliseconds
|
||||
val duration3h = 3.hours.inWholeMilliseconds
|
||||
val duration1h = 1.hours.inWholeMilliseconds
|
||||
val duration1m = 1.minutes.inWholeMilliseconds
|
||||
|
||||
// Calculate the initial delay to make the update time independent of the start time
|
||||
fun calcInitDelay(period: Long) = (period - ((currentTime + duration1h) % period)) + duration1m
|
||||
|
Reference in New Issue
Block a user