From 38b5ae543f5c99eb4ccabbe277770fc6bc81226f Mon Sep 17 00:00:00 2001 From: valentinogeron Date: Sun, 26 Jul 2020 22:32:27 +0300 Subject: add a command_timeout to redisContextOptions (#839) Add an additional timeout so the user has a convenient way of controlling distinct connect and command timeouts --- examples/example-libevent.c | 2 +- examples/example-ssl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/example-libevent.c b/examples/example-libevent.c index f3fa2a6..49bddd0 100644 --- a/examples/example-libevent.c +++ b/examples/example-libevent.c @@ -47,7 +47,7 @@ int main (int argc, char **argv) { REDIS_OPTIONS_SET_TCP(&options, "127.0.0.1", 6379); struct timeval tv = {0}; tv.tv_sec = 1; - options.timeout = &tv; + options.connect_timeout = &tv; redisAsyncContext *c = redisAsyncConnectWithOptions(&options); diff --git a/examples/example-ssl.c b/examples/example-ssl.c index 5eb2bbb..c754177 100644 --- a/examples/example-ssl.c +++ b/examples/example-ssl.c @@ -33,7 +33,7 @@ int main(int argc, char **argv) { struct timeval tv = { 1, 500000 }; // 1.5 seconds redisOptions options = {0}; REDIS_OPTIONS_SET_TCP(&options, hostname, port); - options.timeout = &tv; + options.connect_timeout = &tv; c = redisConnectWithOptions(&options); if (c == NULL || c->err) { -- cgit v1.2.3