File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -28,13 +28,14 @@ public final class RedisConnection {
2828 /// - Returns: An `EventLoopFuture` that resolves when the connection has been closed.
2929 @discardableResult
3030 public func close( ) -> EventLoopFuture < Void > {
31- guard _isClosed. exchange ( with: true ) else { return channel. eventLoop. makeSucceededFuture ( ( ) ) }
31+ guard ! _isClosed. exchange ( with: true ) else { return channel. eventLoop. makeSucceededFuture ( ( ) ) }
3232
33- let promise = channel. eventLoop. makePromise ( of: Void . self)
34-
35- channel. close ( promise: promise)
36-
37- return promise. futureResult
33+ return send ( command: " QUIT " )
34+ . flatMap { _ in
35+ let promise = self . channel. eventLoop. makePromise ( of: Void . self)
36+ self . channel. close ( promise: promise)
37+ return promise. futureResult
38+ }
3839 }
3940
4041 /// Sends the desired command with the specified arguments.
You can’t perform that action at this time.
0 commit comments