add: use SO_REUSEPORT on platform supporting it

This commit is contained in:
Michał Kłeczek
2026-07-15 11:51:21 -05:00
committed by Steve Chavez
parent de19b04fe4
commit c297d051dc
22 changed files with 118 additions and 11 deletions
+4
View File
@@ -26,6 +26,7 @@ module PostgREST.AppState
, isLoaded
, isPending
, waitForSchemaCacheInit
, waitForSchemaCacheLoaded
) where
import qualified Data.ByteString.Char8 as BS
@@ -387,6 +388,9 @@ isSchemaCacheLoaded = atomically . (pure . fromMaybe False <=< tryReadTMVar) . g
waitForSchemaCacheInit :: AppState -> IO ()
waitForSchemaCacheInit = atomically . void . readTMVar . getSCStatusTMVar . stateSCacheStatus
waitForSchemaCacheLoaded :: AppState -> IO ()
waitForSchemaCacheLoaded = atomically . (check <=< readTMVar) . getSCStatusTMVar . stateSCacheStatus
-- | Reads the in-db config and reads the config file again
-- | We don't retry reading the in-db config after it fails immediately, because it could have user errors. We just report the error and continue.
readInDbConfig :: Bool -> AppState -> IO ()