refactor: Remove unnecessary SQL.UsageError parameter from PoolAcqTimeoutObs

PoolAcqTimeoutObs is always created with SQL.AcquisitionTimeoutUsageError so the parameter does not provide any useful information.
On the other hand, it complicates debouncing logic in Logger as logWithDebounce has to lazily create the debouncer (which is error prone and hence the logic has a race condition).

This change removes the parameter from PoolAcqTimeoutObs. It is a prerequisite to simplifying logWithDebounce.
This commit is contained in:
Michał Kłeczek
2026-02-15 13:14:10 -05:00
committed by Steve Chavez
parent c5d495006a
commit d6816d8d2a
4 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -222,7 +222,7 @@ usePool AppState{stateObserver=observer, stateMainThreadId=mainThreadId, ..} ses
whenLeft res (\case
SQL.AcquisitionTimeoutUsageError ->
observer $ PoolAcqTimeoutObs SQL.AcquisitionTimeoutUsageError
observer PoolAcqTimeoutObs
err@(SQL.ConnectionUsageError e) ->
let failureMessage = BS.unpack $ fromMaybe mempty e in
when (("FATAL: password authentication failed" `isInfixOf` failureMessage) || ("no password supplied" `isInfixOf` failureMessage)) $ do