Add a warning log in RedisConnection deinit

This commit is contained in:
Nathan Harris
2019-03-28 22:03:17 -07:00
parent 0797c3f44a
commit 51dd32dabd
+4 -1
View File
@@ -50,7 +50,10 @@ public final class RedisConnection: RedisClient {
private var sentQuitCommand = Atomic<Bool>(value: false)
deinit {
assert(sentQuitCommand.load(), "RedisConnection did not properly shutdown before deinit!")
if !sentQuitCommand.load() {
assertionFailure("close() was not called before deinit!")
logger.warning("RedisConnection did not properly shutdown before deinit!")
}
}
/// Creates a new connection on the provided `Channel`.