remove unneeded dependency, use try catch when writing files
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
8d9fcd3d7c
commit
fe72c02562
|
@ -14,7 +14,6 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.jetbrains.kotlin:kotlin-reflect'
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7'
|
||||
implementation 'org.jsoup:jsoup:1.13.1'
|
||||
|
|
|
@ -190,13 +190,17 @@ class CacheController {
|
|||
* @param timetable a timetable of the type [TimetableCourseWeek]
|
||||
*/
|
||||
private fun saveTimetableToCache(timetable: TimetableCourseWeek) {
|
||||
println(timetable.timetable.toString())
|
||||
|
||||
val file = File(StartupController.dirTcorCache, "timetable-${timetable.meta.courseName}-${timetable.meta.weekIndex}.json")
|
||||
val writer = BufferedWriter(FileWriter(file))
|
||||
|
||||
try {
|
||||
writer.write(Gson().toJson(timetable))
|
||||
} catch (e: Exception) {
|
||||
logger.error("something went wrong while trying to write a cache file", e)
|
||||
} finally {
|
||||
writer.close()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* before the APIController is up, get the data fist
|
||||
|
|
Loading…
Reference in New Issue