on master help sign in
Remove unused /ready endpoint
8c4c066iko
server.knot+1−16
@@ -309,7 +309,6 @@ type RateEntry = {key: Text, windowStart: Timestamp, count: Int}
309-- AuthApi -- challenge/verify (client identity)
309-- AuthApi -- challenge/verify (client identity)
310-- ClientApi -- /poll, /messages (send)
310-- ClientApi -- /poll, /messages (send)
311-- FederationApi -- inter-server gossip, forward (single + batch)
311-- FederationApi -- inter-server gossip, forward (single + batch)
312−-- ReadyApi -- observability
313-- Handlers return `Result HttpError T`: `Ok` produces a 200 with the
312-- Handlers return `Result HttpError T`: `Ok` produces a 200 with the
314-- declared body shape, `Err` produces a non-2xx response whose body is
313-- declared body shape, `Err` produces a non-2xx response whose body is
315-- `{"error": "<code>"}`.
314-- `{"error": "<code>"}`.
@@ -327,10 +326,7 @@ route FederationApi where
327 POST {toKey: PubkeyHex, encryptedBlob: BlobHex, fromServer: ServerName} /federation/forward -> {} = ForwardMessage
326 POST {toKey: PubkeyHex, encryptedBlob: BlobHex, fromServer: ServerName} /federation/forward -> {} = ForwardMessage
328 POST {forwards: [{toKey: PubkeyHex, encryptedBlob: BlobHex}], fromServer: ServerName} /federation/forward-batch -> {results: [{ok: Bool}]} = FederationBatchForward
327 POST {forwards: [{toKey: PubkeyHex, encryptedBlob: BlobHex}], fromServer: ServerName} /federation/forward-batch -> {results: [{ok: Bool}]} = FederationBatchForward
329
328
330−route ReadyApi where
331− GET /ready -> {ready: Bool} = Ready
332−
333−route Api = AuthApi | ClientApi | FederationApi | ReadyApi
329+route Api = AuthApi | ClientApi | FederationApi
334
330
335-- ============================================
331-- ============================================
336-- Generic helpers
332-- Generic helpers
@@ -1190,16 +1186,6 @@ handleFederationBatchForward = \forwards _ -> do
1190 yield {ok: result == ""})
1186 yield {ok: result == ""})
1191 yield (Ok {value: {results}})
1187 yield (Ok {value: {results}})
1192
1188
1193−-- ============================================
1194−-- Readiness handlers
1195−-- ============================================
1196−
1197−-- GET /ready: liveness probe (load-balancer / orchestrator). The process runs
1198−-- a synchronous prune sweep before opening the listener, so any response at
1199−-- all means housekeeping has already happened.
1200−handleReady : IO {} (Result HttpError {ready: Bool})
1201−handleReady = yield (Ok {value: {ready: True}})
1202−
1203-- ============================================
1189-- ============================================
1204-- Dispatch
1190-- Dispatch
1205-- ============================================
1191-- ============================================
@@ -1218,7 +1204,6 @@ api = serve Api where
1218 RecvGossip = \{events, fromServer} -> handleRecvGossip events fromServer
1204 RecvGossip = \{events, fromServer} -> handleRecvGossip events fromServer
1219 ForwardMessage = \{toKey, encryptedBlob, fromServer} -> handleForwardMessage toKey encryptedBlob fromServer
1205 ForwardMessage = \{toKey, encryptedBlob, fromServer} -> handleForwardMessage toKey encryptedBlob fromServer
1220 FederationBatchForward = \{forwards, fromServer} -> handleFederationBatchForward forwards fromServer
1206 FederationBatchForward = \{forwards, fromServer} -> handleFederationBatchForward forwards fromServer
1221− Ready = \{} -> handleReady
1222
1207
1223-- ============================================
1208-- ============================================
1224-- Background loops
1209-- Background loops