Skip to content

Commit

Permalink
call onUnexpectedConnectionClose on closeFuture
Browse files Browse the repository at this point in the history
  • Loading branch information
marius-se committed Jun 13, 2023
1 parent 2fd4db6 commit 43d9445
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Sources/RediStack/RedisConnectionPool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,8 @@ extension RedisConnectionPool {
.map { connection in
// disallow subscriptions on all connections by default to enforce our management of PubSub state
connection.allowSubscriptions = false
connection.onUnexpectedClosure = { [weak self, weak connection] in
guard let connection = connection else { return }
self?.configuration.onUnexpectedConnectionClose?(connection)
connection.channel.closeFuture.whenComplete { _ in
self.configuration.onUnexpectedConnectionClose?(connection)
}
return connection
}
Expand Down

0 comments on commit 43d9445

Please sign in to comment.