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 {
28
28
/// - Returns: An `EventLoopFuture` that resolves when the connection has been closed.
29
29
@discardableResult
30
30
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 ( ( ) ) }
32
32
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
+ }
38
39
}
39
40
40
41
/// Sends the desired command with the specified arguments.
You can’t perform that action at this time.
0 commit comments