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

Function sentinelGetScriptListNodeByPid

app/redis-6.2.6/src/sentinel.c:827–839  ·  view source on GitHub ↗

Lookup a script in the scripts queue via pid, and returns the list node * (so that we can easily remove it from the queue if needed). */

Source from the content-addressed store, hash-verified

825/* Lookup a script in the scripts queue via pid, and returns the list node
826 * (so that we can easily remove it from the queue if needed). */
827listNode *sentinelGetScriptListNodeByPid(pid_t pid) {
828 listNode *ln;
829 listIter li;
830
831 listRewind(sentinel.scripts_queue,&li);
832 while ((ln = listNext(&li)) != NULL) {
833 sentinelScriptJob *sj = ln->value;
834
835 if ((sj->flags & SENTINEL_SCRIPT_RUNNING) && sj->pid == pid)
836 return ln;
837 }
838 return NULL;
839}
840
841/* Run pending scripts if we are not already at max number of running
842 * scripts. */

Callers 1

Calls 2

listRewindFunction · 0.85
listNextFunction · 0.85

Tested by

no test coverage detected