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

Function checkBlockedClientTimeout

src/timeout.cpp:38–50  ·  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

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

Callers 1

Calls 2

unblockClientFunction · 0.85

Tested by

no test coverage detected