refactor: encapsulate application termination

This change makes AppState and Listener modules independent from the way how application is terminated. It removes stateMainThreadId from AppState and introduces stateKillApp. It also removes exported  function AppState.getMainThreadId replacing it with more general killApp.
This commit is contained in:
Michał Kłeczek
2026-07-06 10:29:17 -05:00
committed by Steve Chavez
parent 06bda07db1
commit 56df1dc532
5 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ main = do
let
initApp sCache config = do
appState <- AppState.initWithPool pool config loggerState metricsState (Metrics.observationMetrics metricsState)
appState <- AppState.initWithPool pool config loggerState metricsState (Metrics.observationMetrics metricsState) mempty
AppState.putPgVersion appState actualPgVersion
AppState.putSchemaCache appState (Just sCache)
return ((), postgrest appState (pure ()))