mirror of
https://github.com/gotson/komga.git
synced 2025-01-09 04:08:00 +08:00
fix(komga): better error handling of sse connections
This commit is contained in:
parent
bc49ce46e0
commit
ab34781e9f
@ -11,7 +11,6 @@ plugins {
|
||||
kotlin("plugin.spring")
|
||||
kotlin("kapt")
|
||||
}
|
||||
// 3.1.3+ breaks SSE - https://github.com/spring-projects/spring-framework/issues/31140
|
||||
id("org.springframework.boot") version "3.1.2"
|
||||
id("com.gorylenko.gradle-git-properties") version "2.4.1"
|
||||
id("nu.studer.jooq") version "8.2.1"
|
||||
|
@ -50,7 +50,8 @@ class SseController(
|
||||
if (!acceptingConnections) throw IllegalStateException("Server is shutting down, not accepting new SSE connections")
|
||||
val emitter = SseEmitter()
|
||||
emitter.onCompletion { synchronized(emitters) { emitters.remove(emitter) } }
|
||||
emitter.onTimeout { emitter.complete() }
|
||||
emitter.onTimeout { synchronized(emitters) { emitters.remove(emitter) } }
|
||||
emitter.onError { synchronized(emitters) { emitters.remove(emitter) } }
|
||||
emitters[emitter] = principal.user
|
||||
return emitter
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user