2007-10-16 17:12:48 +00:00
|
|
|
<?php
|
|
|
|
|
2007-10-16 23:02:13 +00:00
|
|
|
require_once("../inc/bossa_db.inc");
|
2007-10-16 17:12:48 +00:00
|
|
|
require_once("../inc/db.inc");
|
|
|
|
|
|
|
|
db_init();
|
|
|
|
|
|
|
|
function make_jobs() {
|
2007-10-16 23:02:13 +00:00
|
|
|
$appname = 'bossa_test';
|
|
|
|
$app = BossaApp::lookup_name($appname);
|
2007-10-16 17:12:48 +00:00
|
|
|
if (!$app) {
|
2007-10-16 23:02:13 +00:00
|
|
|
echo "Application $appname not found\n";
|
2007-10-16 17:12:48 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
2007-10-16 23:02:13 +00:00
|
|
|
$job = new BossaJob;
|
2007-10-16 17:12:48 +00:00
|
|
|
$job->app_id = $app->id;
|
|
|
|
$job->batch = 0;
|
|
|
|
$job->time_estimate = 30;
|
|
|
|
$job->time_limit = 600;
|
|
|
|
$job->nsuccess_needed = 3;
|
|
|
|
for ($i=0; $i<10; $i++) {
|
|
|
|
$job->name = "job_$i";
|
2007-10-18 21:43:25 +00:00
|
|
|
$info = null;
|
|
|
|
$info->number = $i % 2;
|
|
|
|
$job->info = json_encode($info);
|
2007-10-16 23:02:13 +00:00
|
|
|
if (!$job->insert()) {
|
|
|
|
echo "BossaJob::insert failed: ", mysql_error(), "\n";
|
2007-10-16 17:12:48 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
make_jobs();
|
2007-10-16 23:02:13 +00:00
|
|
|
echo "All done.\n";
|
2007-10-16 17:12:48 +00:00
|
|
|
|
|
|
|
?>
|