Kill scripts in timeout, they'll be collected by the * sentinelCollectTerminatedScripts() function. */
| 953 | /* Kill scripts in timeout, they'll be collected by the |
| 954 | * sentinelCollectTerminatedScripts() function. */ |
| 955 | void sentinelKillTimedoutScripts(void) { |
| 956 | listNode *ln; |
| 957 | listIter li; |
| 958 | mstime_t now = mstime(); |
| 959 | |
| 960 | listRewind(sentinel.scripts_queue,&li); |
| 961 | while ((ln = listNext(&li)) != NULL) { |
| 962 | sentinelScriptJob *sj = ln->value; |
| 963 | |
| 964 | if (sj->flags & SENTINEL_SCRIPT_RUNNING && |
| 965 | (now - sj->start_time) > SENTINEL_SCRIPT_MAX_RUNTIME) |
| 966 | { |
| 967 | sentinelEvent(LL_WARNING,"-script-timeout",NULL,"%s %ld", |
| 968 | sj->argv[0], (long)sj->pid); |
| 969 | kill(sj->pid,SIGKILL); |
| 970 | } |
| 971 | } |
| 972 | } |
| 973 | |
| 974 | /* Implements SENTINEL PENDING-SCRIPTS command. */ |
| 975 | void sentinelPendingScriptsCommand(client *c) { |
no test coverage detected