Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send QUIT command when closing the connection without force: true. #154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions neat_cache/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v2.0.2
* Send `QUIT` command when closing the connection without `force: true`.

## v2.0.1
* Fixed issue when adding multiple commands without waiting for them to complete first.

Expand Down
2 changes: 1 addition & 1 deletion neat_cache/lib/src/providers/resp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class RespClient {
Future<void> close({bool force = false}) async {
_closing = true;

if (!_closing) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How was this even supposed to work before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have never sent the QUIT message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I googled it and figured closing the outgoing stream while continuing to read ought to be just as reasonable.

But I'm okay, sending QUIT, why not..

if (!force) {
isoos marked this conversation as resolved.
Show resolved Hide resolved
// Always send QUIT message to be nice
try {
final quit = command(['QUIT']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will throw if _closing = true I guess we need to set it later...

Expand Down
2 changes: 1 addition & 1 deletion neat_cache/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: neat_cache
version: 2.0.1
version: 2.0.2-dev
description: |
A neat cache abstraction for wrapping in-memory or redis caches.
homepage: https://github.com/google/dart-neats/tree/master/neat_cache
Expand Down