Skip to content

Commit

Permalink
[FEAT] Add condition for flush!
Browse files Browse the repository at this point in the history
  • Loading branch information
captchanjack committed Feb 1, 2022
1 parent 226ff5d commit 59acb84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Jedis"
uuid = "b89ccfe0-2c5f-46f6-b89b-da3e1c2e286f"
authors = ["Jack Chan <[email protected]>"]
version = "0.2.10"
version = "0.2.11"

[deps]
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
Expand Down
6 changes: 4 additions & 2 deletions src/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ Reads and discards any bytes that remain unread in the client socket.
"""
function flush!(client::Client)
nb = bytesavailable(client.socket)
buffer = Vector{UInt8}(undef, nb)
readbytes!(client.socket, buffer, nb)
if nb > 0
buffer = Vector{UInt8}(undef, nb)
readbytes!(client.socket, buffer, nb)
end
end

"""
Expand Down

2 comments on commit 59acb84

@captchanjack
Copy link
Owner Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/53594

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.11 -m "<description of version>" 59acb840451e1644eb00925832942defd03b02d5
git push origin v0.2.11

Please sign in to comment.