MCPcopy Create free account
hub / github.com/F-Stack/f-stack / checkBlockedClientTimeout

Function checkBlockedClientTimeout

app/redis-6.2.6/src/timeout.c:37–49  ·  view source on GitHub ↗

Check if this blocked client timedout (does nothing if the client is * not blocked right now). If so send a reply, unblock it, and return 1. * Otherwise 0 is returned and no operation is performed. */

Source from the content-addressed store, hash-verified

35 * not blocked right now). If so send a reply, unblock it, and return 1.
36 * Otherwise 0 is returned and no operation is performed. */
37int checkBlockedClientTimeout(client *c, mstime_t now) {
38 if (c->flags & CLIENT_BLOCKED &&
39 c->bpop.timeout != 0
40 && c->bpop.timeout < now)
41 {
42 /* Handle blocking operation specific timeout. */
43 replyToBlockedClientTimedOut(c);
44 unblockClient(c);
45 return 1;
46 } else {
47 return 0;
48 }
49}
50
51/* Check for timeouts. Returns non-zero if the client was terminated.
52 * The function gets the current time in milliseconds as argument since

Callers 1

Calls 2

unblockClientFunction · 0.85

Tested by

no test coverage detected