1
0
Fork 1
mirror of https://gitlab.com/mangadex-pub/mangadex_at_home.git synced 2024-01-19 02:48:37 +00:00

Change logging and update spotless

This commit is contained in:
carbotaniuman 2020-08-27 14:23:24 +00:00
parent dfd6777b45
commit 35567bba1d
3 changed files with 3 additions and 7 deletions

View file

@ -4,7 +4,7 @@ plugins {
id "org.jetbrains.kotlin.kapt" version "1.4.0" id "org.jetbrains.kotlin.kapt" version "1.4.0"
id "application" id "application"
id "com.github.johnrengelman.shadow" version "5.2.0" id "com.github.johnrengelman.shadow" version "5.2.0"
id "com.diffplug.gradle.spotless" version "4.4.0" id "com.diffplug.spotless" version "5.2.0"
id "dev.afanasev.sekret" version "0.0.7" id "dev.afanasev.sekret" version "0.0.7"
} }

View file

@ -121,11 +121,9 @@ class ImageServer(
} }
) )
} catch (e: JsonProcessingException) { } catch (e: JsonProcessingException) {
println(e)
LOGGER.info(e) { "Request for $sanitizedUri rejected for invalid token" } LOGGER.info(e) { "Request for $sanitizedUri rejected for invalid token" }
return@then Response(Status.FORBIDDEN) return@then Response(Status.FORBIDDEN)
} }
println(token)
if (OffsetDateTime.now().isAfter(token.expires)) { if (OffsetDateTime.now().isAfter(token.expires)) {
LOGGER.info { "Request for $sanitizedUri rejected for expired token" } LOGGER.info { "Request for $sanitizedUri rejected for expired token" }
@ -276,11 +274,9 @@ class ImageServer(
if (editor.getLength(0) == contentLength.toLong()) { if (editor.getLength(0) == contentLength.toLong()) {
LOGGER.info { "Cache download for $sanitizedUri committed" } LOGGER.info { "Cache download for $sanitizedUri committed" }
editor.commit() editor.commit()
println("A")
cache.flush() cache.flush()
} else { } else {
LOGGER.warn { "Cache download for $sanitizedUri aborted" } LOGGER.warn { "Cache download for $sanitizedUri aborted" }
println("B")
editor.abort() editor.abort()
} }
} catch (e: Exception) { } catch (e: Exception) {

View file

@ -8,8 +8,8 @@
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>log/logFile.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern> <fileNamePattern>log/logFile.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
<maxHistory>12</maxHistory> <maxHistory>12</maxHistory>
<maxFileSize>100MB</maxFileSize> <maxFileSize>32MB</maxFileSize>
<totalSizeCap>1GB</totalSizeCap> <totalSizeCap>256MB</totalSizeCap>
</rollingPolicy>--> </rollingPolicy>-->
<encoder> <encoder>