Skip to content

Commit 43d9445

Browse files
committed
call onUnexpectedConnectionClose on closeFuture
1 parent 2fd4db6 commit 43d9445

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Sources/RediStack/RedisConnectionPool.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,8 @@ extension RedisConnectionPool {
208208
.map { connection in
209209
// disallow subscriptions on all connections by default to enforce our management of PubSub state
210210
connection.allowSubscriptions = false
211-
connection.onUnexpectedClosure = { [weak self, weak connection] in
212-
guard let connection = connection else { return }
213-
self?.configuration.onUnexpectedConnectionClose?(connection)
211+
connection.channel.closeFuture.whenComplete { _ in
212+
self.configuration.onUnexpectedConnectionClose?(connection)
214213
}
215214
return connection
216215
}

0 commit comments

Comments
 (0)