Merge branch 'requery' into 'master'

Change logging and update spotless

Closes #74

See merge request mangadex-pub/mangadex_at_home!66
This commit is contained in:
carbotaniuman 2020-08-27 14:23:24 +00:00
commit 9ce7eccb47
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 "application"
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"
}

View file

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

View file

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