fixed the Sunday-fix
This commit is contained in:
parent
a7abd48726
commit
c6ac19bfae
|
@ -49,7 +49,7 @@ class CacheController(cont: Context) {
|
||||||
cal.time = Date(mensaMenu.meta.updateTime * 1000)
|
cal.time = Date(mensaMenu.meta.updateTime * 1000)
|
||||||
|
|
||||||
// if a) it's monday and the last cache update was on sunday or b) the cache is older than 24hr, update blocking
|
// if a) it's monday and the last cache update was on sunday or b) the cache is older than 24hr, update blocking
|
||||||
if ((currentDay == Calendar.MONDAY && cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) || currentTime - mensaMenu.meta.updateTime > 86400) {
|
if ((currentDay == Calendar.MONDAY && cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) || (currentTime - mensaMenu.meta.updateTime) > 86400) {
|
||||||
println("update mensa blocking")
|
println("update mensa blocking")
|
||||||
TCoRAPIController.getMensa(context).get()
|
TCoRAPIController.getMensa(context).get()
|
||||||
}
|
}
|
||||||
|
@ -58,8 +58,8 @@ class CacheController(cont: Context) {
|
||||||
readTimetable(cCourse.courseName, 0, context)
|
readTimetable(cCourse.courseName, 0, context)
|
||||||
cal.time = Date(timetables[0].meta.updateTime * 1000)
|
cal.time = Date(timetables[0].meta.updateTime * 1000)
|
||||||
|
|
||||||
// if a) it`s monday and the last cache update was not on a sunday or b) the cache is older than 5 days, update blocking
|
// if a) it`s monday and the last cache update was not on a sunday or b) the cache is older than 24hr, update blocking
|
||||||
if((currentDay == Calendar.MONDAY && cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) || currentTime - timetables[0].meta.updateTime > 432000) {
|
if((currentDay == Calendar.MONDAY && cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) || (currentTime - timetables[0].meta.updateTime) > 86400) {
|
||||||
println("updating timetable after sunday!")
|
println("updating timetable after sunday!")
|
||||||
val jobA = TCoRAPIController.getTimetable(cCourse.courseName, 0, context)
|
val jobA = TCoRAPIController.getTimetable(cCourse.courseName, 0, context)
|
||||||
val jobB = TCoRAPIController.getTimetable(cCourse.courseName, 1, context)
|
val jobB = TCoRAPIController.getTimetable(cCourse.courseName, 1, context)
|
||||||
|
|
Loading…
Reference in New Issue