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