Skip to content

Commit 8371d00

Browse files
committed
Spin off test write into a task to ensure redis has been launched
1 parent ddef31d commit 8371d00

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/App/configure.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public func configure(_ app: Application) async throws -> String {
8181
// Setup Redis connection
8282
do {
8383
app.redis.configuration = try RedisConfiguration(hostname: "redis")
84-
do { // write-read test across nodes
84+
Task { // write-read test across nodes
85+
try await Task.sleep(for: .seconds(5)) // give redis some spin-up time
8586
let key = "startup-time-\(app.http.server.configuration.hostname)"
8687
try await app.redis.set(.init(key), to: "\(Date.now)").get()
8788
if let value = try await app.redis.get(.init(key), as: String.self).get() {

0 commit comments

Comments
 (0)