Skip to content

Commit 51dd32d

Browse files
committed
Add a warning log in RedisConnection deinit
1 parent 0797c3f commit 51dd32d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/NIORedis/RedisClient.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ public final class RedisConnection: RedisClient {
5050
private var sentQuitCommand = Atomic<Bool>(value: false)
5151

5252
deinit {
53-
assert(sentQuitCommand.load(), "RedisConnection did not properly shutdown before deinit!")
53+
if !sentQuitCommand.load() {
54+
assertionFailure("close() was not called before deinit!")
55+
logger.warning("RedisConnection did not properly shutdown before deinit!")
56+
}
5457
}
5558

5659
/// Creates a new connection on the provided `Channel`.

0 commit comments

Comments
 (0)