fix: configure postgres idle timeout and connection recycling for Railway

Railway proxy closes idle DB connections after ~60s, causing
CONNECTION_CLOSED errors on stale sockets. Set idle_timeout=20s and
max_lifetime=5m so postgres-js recycles connections before they die.

Also fix sendCommand to fall back to persistent device ID on reconnect.
This commit is contained in:
Sanju Sivalingam
2026-02-18 13:56:34 +05:30
parent 3bab84f611
commit 88af77ddc7
4 changed files with 13 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import com.thisux.droidclaw.model.DeviceInfoMsg
import com.thisux.droidclaw.model.ServerMessage
import io.ktor.client.HttpClient
import io.ktor.client.engine.cio.CIO
import io.ktor.client.engine.cio.endpoint
import io.ktor.client.plugins.websocket.WebSockets
import io.ktor.client.plugins.websocket.webSocket
import io.ktor.websocket.Frame