$BOOL_EXECUTE_JOB_OUTPUT_EXPRESSIONS = true; $BOOL_EXECUTE_MERGING = true; $BOOL_FIND_NEW_JOB = true; $JOB_FAILED = false; $JOB_FAIL_STATUS = "failed"; $STDOUT = ""; $PARENT_JOB = false; $OUTPUT_CONTENT = ""; $PROCESS_MANAGER = new Processmanager(); $new_job_news = new job_new(); // CHECK FOR JOBS THAT ARE ALREADY "RUNNING" or "PAUSED" (AWAITING MERGING) $unfinished_jobs = array(); $statuses = array("running", "paused", "merging", "undefined"); $existent_statuses = array(); foreach ($statuses as $a_status) { $check_existing_jobs = new job_status(); $already_existing_jobs_assigned_to_this_server = $check_existing_jobs->get_from_hashrange($id_user, $a_status . "#" . $INSTANCE_NAME . "@", "BEGINS_WITH"); if ($already_existing_jobs_assigned_to_this_server && count($already_existing_jobs_assigned_to_this_server) > 0) { foreach ($already_existing_jobs_assigned_to_this_server as &$old_existing_job) { $check_is_child = new ph_child(); $check_is_child->get_from_hashrange(explode("#", $old_existing_job['id_status_job'])[1]); if ($check_is_child->id_child_job != "undefined") { $old_existing_job['id_parent_job'] = $check_is_child->id_parent_job; } else { $old_existing_job['id_parent_job'] = false; } $existent_statuses[$a_status] = true; $unfinished_jobs[] = $old_existing_job; } } }
public function delete_job_status() { global $APP; if ($APP['ms']->kind != "no-messaging") { // SOME TYPE OF MESSAGING IS BEING USED } else { $check_job_status = new job_status(); $check_job_status->get_from_hashrange($this->id_user, $this->id_status . "#" . $this->id); if ($check_job_status->id_user != "undefined") { $check_job_status->delete(); } } // END IF }
foreach ($new_jobs as $new_job) { echo getTranslation("Job ID", $settings); echo ": "; echo $new_job['id']; echo "<br/>"; } } if (!$new_jobs || count($new_jobs) == 0) { echo getTranslation("No waiting jobs found.", $settings); } echo "</ul>"; echo "<form action='?q={$qn}&v=job-servers' method='post'><input style='background-color:" . rcolor() . ";display:inline;' type='submit' value='"; echo getTranslation("Refresh", $settings); echo "'/></form>"; } $working_job = new job_status(); $unfinished_jobs = $working_job->get_from_hashrange($u->id_user); $unique_statuses = array(); if (count($unfinished_jobs) > 0) { foreach ($unfinished_jobs as $unfinished_job) { $status = explode("#", $unfinished_job['id_status_job'])[0]; if (in_array($status, array_keys($unique_statuses))) { $unique_statuses[$status] = intval($unique_statuses[$status]) + 1; } else { $unique_statuses[$status] = 1; } } } $status_string = ""; $idx = 0; foreach ($unique_statuses as $skey => $sval) {