MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / redisAsyncSetTimeout

Function redisAsyncSetTimeout

deps/hiredis/async.c:870–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

868}
869
870int redisAsyncSetTimeout(redisAsyncContext *ac, struct timeval tv) {
871 if (!ac->c.command_timeout) {
872 ac->c.command_timeout = hi_calloc(1, sizeof(tv));
873 if (ac->c.command_timeout == NULL) {
874 __redisSetError(&ac->c, REDIS_ERR_OOM, "Out of memory");
875 __redisAsyncCopyError(ac);
876 return REDIS_ERR;
877 }
878 }
879
880 if (tv.tv_sec != ac->c.command_timeout->tv_sec ||
881 tv.tv_usec != ac->c.command_timeout->tv_usec)
882 {
883 *ac->c.command_timeout = tv;
884 }
885
886 return REDIS_OK;
887}

Callers

nothing calls this directly

Calls 3

__redisSetErrorFunction · 0.85
__redisAsyncCopyErrorFunction · 0.85
hi_callocFunction · 0.70

Tested by

no test coverage detected