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

Function sentinelGetScriptListNodeByPid

src/sentinel.cpp:829–841  ·  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

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

Callers 1

Calls 2

listRewindFunction · 0.85
listNextFunction · 0.85

Tested by

no test coverage detected