We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2e1170 commit 31c288eCopy full SHA for 31c288e
Tests/AppTests/Helpers/DatabasePool.swift
@@ -29,6 +29,10 @@ actor DatabasePool {
29
}
30
31
32
+ struct Error: Swift.Error {
33
+ var message: String
34
+ }
35
+
36
static let shared = DatabasePool(maxCount: Environment.databasePoolSize)
37
38
var maxCount: Int
@@ -157,6 +161,9 @@ actor DatabasePool {
157
161
if retry > 0 && retry % 50 == 0 {
158
162
print("ℹ️ \(#function) available databases: \(availableDatabases.count) retry \(retry)")
159
163
164
+ if retry >= 1000 {
165
+ throw Error(message: "Retry count exceeded")
166
160
167
try await Task.sleep(for: .milliseconds(100))
168
database = availableDatabases.randomElement()
169
0 commit comments