Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
011f7093
Commit
011f7093
authored
Mar 05, 2023
by
michael-grunder
Committed by
Michael Grunder
Mar 07, 2023
Browse files
Allow specifying the keepalive interval
Fixes #1155
parent
e9243d4f
Changes
2
Show whitespace changes
Inline
Side-by-side
hiredis.c
View file @
011f7093
...
...
@@ -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. */
...
...
hiredis.h
View file @
011f7093
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment