fixed the Sunday-fix
This commit is contained in:
		@ -49,7 +49,7 @@ class CacheController(cont: Context) {
 | 
			
		||||
        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 ((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")
 | 
			
		||||
            TCoRAPIController.getMensa(context).get()
 | 
			
		||||
        }
 | 
			
		||||
@ -58,8 +58,8 @@ class CacheController(cont: Context) {
 | 
			
		||||
        readTimetable(cCourse.courseName, 0, context)
 | 
			
		||||
        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((currentDay == Calendar.MONDAY && cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) || currentTime - timetables[0].meta.updateTime > 432000) {
 | 
			
		||||
        // 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) > 86400) {
 | 
			
		||||
            println("updating timetable after sunday!")
 | 
			
		||||
            val jobA = TCoRAPIController.getTimetable(cCourse.courseName, 0, context)
 | 
			
		||||
            val jobB = TCoRAPIController.getTimetable(cCourse.courseName, 1, context)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user