$message = $new_job_id->receive("replyfrom_" . $selected_job_server_name); $all_messages .= $message . "<br/>\n"; if (($message . "" == "NULL" || strlen($message . "") == 0) && $cnt < 15) { sleep(1); continue; } $message_xml = xmlToArray(simplexml_load_string($message)); $collected_job_id = new job_id_user(); $collected_job_id->fromobjectxml($message_xml); if ($collected_job_id->id == $id_submitted_job) { $new_job_id->fromobjectxml($message_xml); $messaging_complete = True; } else { $all_messages .= "received a wrong message: " . htmlspecialchars($message); // we collected a message from anoth/er job - re-post the message to the queue so we don't end up stealing other jobs' responses $collected_job_id->send("replyfrom_" . $selected_job_server_name, $message); } } else { $new_job_id->get_from_hashrange($u->id_user, $new_job_id->id); } if ($new_job_id->id_status != 'running' && $new_job_id->id_status != 'new' && $new_job_id->id_status != 'paused') { // JOB IS DONE break; } else { sleep(1); } } // END WHILE (WAIT FOR JOB TO FINISH) $new_job_id->build(); $gather_from = "obj_response"; if ($mode_xml || $mode_cxml) {
// end if (job is completed) } // END IF $JID_MERGE_CHECK = "undefined"; break; } // end if ( IS NOT A PLACEHOLDER FROM ANOTHER JOB) } // END WHILE (RECURSIVELY MERGE SIBLINGS INTO PARENT VALUES) } // end if (JOB SUCCEEDED) } // END IF ($BOOL_EXECUTE_JOB_PARENT_MERGING) if ($APP['ms']->kind != "no-messaging" && $JOB->obj_hf->int_wait . "" == "1") { logger("\t" . "SENDING UPDATE MESSAGE\n"); $JOB->send("replyfrom_" . $INSTANCE_NAME, $JOB->toobjectxml()); } if ($BOOL_EXECUTE_JOB_EXECUTION || $JOB_FAILED) { // UPDATE THE LATEST CACHE IF THAT MODE WAS SUBMITTED WITH THE JOB if (isset($the_post['action'])) { if ($the_post['action'] == "regather-latest-cache") { logger("\n\tUPDATING LATEST CACHE\n"); sleep(1); // OUTPUT_CONTENT = string url already $sha1_string = sha1(microtime() . $OUTPUT_CONTENT); $new_string = new strings(); $props = array(); $props["id"] = $sha1_string; $props["val"] = $OUTPUT_CONTENT; $new_string->create_raw($props); $sha2_string = sha1(microtime() . $OUTPUT_LOCATION);