summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hiredis.c8
-rw-r--r--hiredis.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/hiredis.c b/hiredis.c
index 55df883..26e1ed6 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -942,11 +942,13 @@ int redisSetTimeout(redisContext *c, const struct timeval tv) {
return REDIS_ERR;
}
+int redisEnableKeepAliveWithInterval(redisContext *c, int interval) {
+ return redisKeepAlive(c, interval);
+}
+
/* Enable connection KeepAlive. */
int redisEnableKeepAlive(redisContext *c) {
- if (redisKeepAlive(c, REDIS_KEEPALIVE_INTERVAL) != REDIS_OK)
- return REDIS_ERR;
- return REDIS_OK;
+ return redisKeepAlive(c, REDIS_KEEPALIVE_INTERVAL);
}
/* Set a user provided RESP3 PUSH handler and return any old one set. */
diff --git a/hiredis.h b/hiredis.h
index a945d65..3c112dc 100644
--- a/hiredis.h
+++ b/hiredis.h
@@ -328,6 +328,7 @@ int redisReconnect(redisContext *c);
redisPushFn *redisSetPushCallback(redisContext *c, redisPushFn *fn);
int redisSetTimeout(redisContext *c, const struct timeval tv);
int redisEnableKeepAlive(redisContext *c);
+int redisEnableKeepAliveWithInterval(redisContext *c, int interval);
void redisFree(redisContext *c);
redisFD redisFreeKeepFd(redisContext *c);
int redisBufferRead(redisContext *c);