コード例 #1
0
ファイル: controller.server.php プロジェクト: hisapi/his
 usort($current_not_busy_servers, "lastpingordersort");
 $current_not_busy_servers_by_name = array();
 foreach ($current_not_busy_servers as $current_not_busy_server) {
     $current_not_busy_servers_by_name[$current_not_busy_server['name']] = $current_not_busy_server;
 }
 //echo "CURRENT NOT BUSY SERVERS:";print_r($current_not_busy_servers_by_name);
 $reassign_jobs_older_than_seconds = 60 * 60;
 // 1 hour
 $assigned_servers = array();
 //echo "FIRST SERVER:".$current_not_busy_servers[0]['name'];
 //   IS THIS SERVER THE FIRST IN THE LIST?
 if (count($current_not_busy_servers) > 0) {
     //echo "HOW MANY WAITING JOBS?";
     // HOW MANY WAITING JOBS
     $get_jobs = new job_new();
     $all_jobs = $get_jobs->get_from_hashrange($id_user);
     //echo "THIS IS REASSIGNER NODE";
     $first_list_length = 3;
     $first_server_jobs = array();
     if (count($user_servers) == count($not_busy_servers)) {
         $first_list_length = 0;
     }
     if ($all_jobs) {
         foreach ($all_jobs as $each_job) {
             $job_id = $each_job['id'];
             $server_name_split = explode("@", $job_id);
             $server_name = $server_name_split[0];
             if (!isset($first_server_jobs[$server_name])) {
                 $first_server_jobs[$server_name] = array();
             }
             if (count($first_server_jobs[$server_name]) < $first_list_length) {
コード例 #2
0
ファイル: model.classes.php プロジェクト: hisapi/his
 public function delete_job_new()
 {
     global $APP;
     if ($APP['ms']->kind != "no-messaging") {
         // SOME TYPE OF MESSAGING IS BEING USED
     } else {
         $check_new_job = new job_new();
         $check_new_job->get_from_hashrange($this->id_user, $this->id);
         if ($check_new_job->id != "undefined") {
             $check_new_job->delete();
         }
     }
     // END IF
 }
コード例 #3
0
ファイル: view.main.php プロジェクト: hisapi/his
        echo "</td></tr>";
        echo "</table>";
    }
}
// end if (cluster map)
if (isset($_GET['v'])) {
    if ($_GET['v'] == "job-servers") {
        echo "<a name='queue'><h3>" . getTranslation("Job Queue/List of Jobs", $settings) . "</h3>";
        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>";
        if ($APP['ms']->kind == "no-messaging") {
            echo "<ul>";
            $new_job = new job_new();
            $new_jobs = $new_job->get_from_hashrange($u->id_user);
            if ($new_jobs) {
                echo "<h3>";
                echo getTranslation("New Jobs", $settings);
                echo " ";
                echo "(";
                echo count($new_jobs);
                echo ")";
                echo "</h3>";
                foreach ($new_jobs as $new_job) {
                    echo getTranslation("Job ID", $settings);
                    echo ": ";
                    echo $new_job['id'];
                    echo "<br/>";
                }
            }