Ejemplo n.º 1
0
function do_pass()
{
    $int_max = 2147483647;
    $now = time();
    $insts = BossaJobInst::enum("timeout < {$now}");
    if (!count($insts)) {
        return false;
    }
    foreach ($insts as $inst) {
        BossaDb::start_transaction();
        $inst = BossaJobInst::lookup_id($inst->id);
        // reread instance within transation
        if ($inst->transition_time < $now) {
            $job = BossaJob::lookup_id($inst->job_id);
            $user = BoincUser::lookup_id($inst->user_id);
            BossaUser::lookup($user);
            job_timed_out($job, $inst, $user);
        }
        $inst->update("timeout={$int_max}");
        BossaDb::commit();
    }
    return true;
}
Ejemplo n.º 2
0
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/util.inc";
require_once "../inc/bossa_db.inc";
require_once "../inc/bossa_impl.inc";
$user = get_logged_in_user();
$inst = BossaJobInst::lookup_id(get_int('bji'));
if (!$inst) {
    error_page("No such job instance");
}
if ($inst->user_id != $user->id) {
    error_page("Bad user ID");
}
if ($inst->finish_time) {
    error_page("You already finished this job");
}
$job = BossaJob::lookup_id($inst->job_id);
if (!$job) {
    error_page("No such job");
}
$app = BossaApp::lookup_id($job->app_id);
$file = "../inc/{$app->short_name}.inc";
require_once $file;
$trans = new BossaTransaction();
$now = time();
$inst->update("finish_time={$now}, timeout=0");
BossaUser::lookup($user);
job_finished($job, $inst, $user);
show_next_job($app, $user);
Ejemplo n.º 3
0
function show_bossa_user()
{
    $user_id = get_int('user_id');
    $app_id = get_int('app_id');
    $user = BoincUser::lookup_id("{$user_id}");
    BossaUser::lookup($user);
    $app = BossaApp::lookup_id($app_id);
    include_app_file($app_id);
    admin_page_head("{$user->name} ({$app->name})");
    $x = user_summary($user);
    if ($x) {
        echo "User info: {$x}<br>";
    }
    $insts = BossaJobInst::enum("user_id={$user_id}");
    start_table();
    table_header("Job", "Calibration?", "Start", "Duration", "Response");
    foreach ($insts as $inst) {
        $job = BossaJob::lookup_id($inst->job_id);
        table_row("{$inst->job_id} <a href=bossa_admin.php?action=job_show_insts&job_id={$inst->job_id}>(details)</a><br>" . job_summary($job), calibration_job_string($inst, $job), time_str($inst->create_time), job_duration($inst), instance_summary($inst->get_opaque_data()));
    }
    end_table();
    admin_page_tail();
}