Timeouts for http server (#788)

This commit is contained in:
KirillPamPam
2026-02-04 16:01:25 +04:00
committed by GitHub
parent 1b12d83066
commit 9b5e7ca54e

View File

@@ -42,6 +42,14 @@ fun main(args: Array<String>) {
Hooks.enableAutomaticContextPropagation()
OpenSsl.ensureAvailability()
if (!System.getProperties().containsKey("sun.net.httpserver.maxReqTime")) {
System.setProperty("sun.net.httpserver.maxReqTime", "60")
}
if (!System.getProperties().containsKey("sun.net.httpserver.maxRspTime")) {
System.setProperty("sun.net.httpserver.maxRspTime", "600")
}
// add metrics for internal reactor schedulers
Schedulers.addExecutorServiceDecorator("key") { scheduler, execService ->
val schedulerName = Scannable.from(scheduler).scanOrDefault(Attr.NAME, scheduler.javaClass.name)