Skip to content

Commit 97c21e3

Browse files
authored
Merge pull request #120 from JuliaDatabases/fix/cluster-precompile-time
fix: precompilation and conflicting cluster _time
2 parents 97d108a + 02880ba commit 97c21e3

3 files changed

Lines changed: 3 additions & 23 deletions

File tree

src/client.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const CLUSTER_MULTI_KEY_COMMANDS = Set([
2727
"eval", "evalsha",
2828

2929
# Server commands - need to broadcast to all nodes
30-
"flushall", "flushdb", "_time",
30+
"flushall", "flushdb",
3131

3232
# Pub/Sub commands - need special handling
3333
"publish"

src/cluster_commands.jl

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -705,29 +705,11 @@ function flushdb(cluster::RedisClusterConnection, db::Integer)
705705
return "OK"
706706
end
707707

708-
"""
709-
_time(cluster::RedisClusterConnection)
710-
711-
Cluster version of TIME - returns time from a random node.
712-
Returns current Unix time from one of the cluster nodes.
713-
"""
714-
function _time(cluster::RedisClusterConnection)
715-
if isempty(cluster.node_connections)
716-
throw(ConnectionException("No active connections in cluster"))
717-
end
718-
719-
# Get time from a random master node
720-
connections = collect(values(cluster.node_connections))
721-
random_conn = rand(connections)
722-
723-
response = execute_command(random_conn, ["TIME"])
724-
return convert_response(Array{AbstractString,1}, response)
725-
end
726-
727708
"""
728709
time(cluster::RedisClusterConnection)
729710
730-
Cluster version of TIME - returns DateTime from a random node.
711+
Cluster version of TIME - returns DateTime from a cluster node.
712+
Uses the `_time` method generated by `@redisfunction`.
731713
"""
732714
function time(cluster::RedisClusterConnection)
733715
t = _time(cluster)

src/parser.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
Formatting of incoming Redis Replies
33
"""
44

5-
include("connection.jl")
6-
75
function getline(t::Transport.RedisTransport)
86
l = chomp(Transport.read_line(t))
97
length(l) > 1 || throw(ProtocolException("Invalid response received: $l"))

0 commit comments

Comments
 (0)