diff options
author | valentinogeron <valentino@redislabs.com> | 2020-07-26 22:32:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-26 12:32:27 -0700 |
commit | 38b5ae543f5c99eb4ccabbe277770fc6bc81226f (patch) | |
tree | 9377e746a4fce5ab34730f16c06c11db3bbfb839 /async.c | |
parent | 3bb985314d0563857c84beef0097ffc8de2d9438 (diff) |
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
Diffstat (limited to 'async.c')
-rw-r--r-- | async.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -868,19 +868,19 @@ redisAsyncPushFn *redisAsyncSetPushCallback(redisAsyncContext *ac, redisAsyncPus } int redisAsyncSetTimeout(redisAsyncContext *ac, struct timeval tv) { - if (!ac->c.timeout) { - ac->c.timeout = hi_calloc(1, sizeof(tv)); - if (ac->c.timeout == NULL) { + if (!ac->c.command_timeout) { + ac->c.command_timeout = hi_calloc(1, sizeof(tv)); + if (ac->c.command_timeout == NULL) { __redisSetError(&ac->c, REDIS_ERR_OOM, "Out of memory"); __redisAsyncCopyError(ac); return REDIS_ERR; } } - if (tv.tv_sec != ac->c.timeout->tv_sec || - tv.tv_usec != ac->c.timeout->tv_usec) + if (tv.tv_sec != ac->c.command_timeout->tv_sec || + tv.tv_usec != ac->c.command_timeout->tv_usec) { - *ac->c.timeout = tv; + *ac->c.command_timeout = tv; } return REDIS_OK; |