correct exponential backoff on Listener
Clears the limitation mentioned on https://github.com/PostgREST/postgrest/pull/3536 The Listener no longer uses the https://hackage.haskell.org/package/retry package and instead uses a much simpler IORef in AppState for the delays. Additionally it no longer uses exception throwing/catching, which is rather messy and brings some concerns(https://github.com/PostgREST/postgrest/issues/3569#issuecomment-2146013327).
This commit is contained in:
committed by
Steve Chavez
parent
aaf2d2e430
commit
1a8b6972a8
@@ -120,7 +120,7 @@ postgrest logLevel appState connWorker =
|
||||
-- the connWorker is done.
|
||||
when (isServiceUnavailable response) connWorker
|
||||
resp <- do
|
||||
delay <- AppState.getRetryNextIn appState
|
||||
delay <- AppState.getNextDelay appState
|
||||
return $ addRetryHint delay response
|
||||
respond resp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user