1 parent 4b7723e commit 1b002dcCopy full SHA for 1b002dc
1 file changed
Sources/PostgresConnectionPool/PostgresConnectionPool.swift
@@ -562,14 +562,17 @@ public actor PostgresConnectionPool {
562
// TODO: Check which of these errors is actually fatal
563
switch PostgresError.Code(raw: code) {
564
case .adminShutdown,
565
- .cannotConnectNow,
566
.invalidAuthorizationSpecification,
567
.invalidName,
568
.invalidPassword:
569
logger.error(logMessage)
570
await shutdown(withError: psqlError)
571
return
572
+ case .cannotConnectNow:
573
+ let delay = UInt64(connectionRetryInterval * 1_000_000_000)
574
+ try? await Task<Never, Never>.sleep(nanoseconds: delay)
575
+
576
default:
577
break
578
}
0 commit comments