use HashMap insted of ArrayList to store the timetables
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-06-06 23:07:23 +02:00
parent fe72c02562
commit f9029bf1c3
4 changed files with 29 additions and 40 deletions

View File

@ -134,7 +134,8 @@ class StartupController {
try {
val timetableObject = JsonParser.parseString(bufferedReader.readLine()).asJsonObject
CacheController.timetableList.add(Gson().fromJson(timetableObject, TimetableCourseWeek().javaClass))
val timetable = Gson().fromJson(timetableObject, TimetableCourseWeek().javaClass)
CacheController.timetableList.put("${timetable.meta.courseName}-${timetable.meta.weekIndex}", timetable)
} catch (ex: Exception) {
logger.error("error while reading cache", ex)
} finally {