diff --git a/src/client.jl b/src/client.jl index 13e68be..91b613f 100644 --- a/src/client.jl +++ b/src/client.jl @@ -27,7 +27,7 @@ const CLUSTER_MULTI_KEY_COMMANDS = Set([ "eval", "evalsha", # Server commands - need to broadcast to all nodes - "flushall", "flushdb", "_time", + "flushall", "flushdb", # Pub/Sub commands - need special handling "publish" diff --git a/src/cluster_commands.jl b/src/cluster_commands.jl index 5a89aa9..aecb1b7 100644 --- a/src/cluster_commands.jl +++ b/src/cluster_commands.jl @@ -705,29 +705,11 @@ function flushdb(cluster::RedisClusterConnection, db::Integer) return "OK" end -""" - _time(cluster::RedisClusterConnection) - -Cluster version of TIME - returns time from a random node. -Returns current Unix time from one of the cluster nodes. -""" -function _time(cluster::RedisClusterConnection) - if isempty(cluster.node_connections) - throw(ConnectionException("No active connections in cluster")) - end - - # Get time from a random master node - connections = collect(values(cluster.node_connections)) - random_conn = rand(connections) - - response = execute_command(random_conn, ["TIME"]) - return convert_response(Array{AbstractString,1}, response) -end - """ time(cluster::RedisClusterConnection) -Cluster version of TIME - returns DateTime from a random node. +Cluster version of TIME - returns DateTime from a cluster node. +Uses the `_time` method generated by `@redisfunction`. """ function time(cluster::RedisClusterConnection) t = _time(cluster) diff --git a/src/parser.jl b/src/parser.jl index a3fa2cf..53bfea1 100644 --- a/src/parser.jl +++ b/src/parser.jl @@ -2,8 +2,6 @@ Formatting of incoming Redis Replies """ -include("connection.jl") - function getline(t::Transport.RedisTransport) l = chomp(Transport.read_line(t)) length(l) > 1 || throw(ProtocolException("Invalid response received: $l"))