summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64e1a22)
raw | patch | inline | side by side (parent: 64e1a22)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 4 Mar 2008 09:17:19 +0000 (09:17 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 4 Mar 2008 09:17:19 +0000 (09:17 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9288 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 667a8f8fc1510f4f28ca7fdfafcbdddd7c1cf243..f3b7f143651a16882f276756d61a617d2fef9ae7 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
sub trigger_db_loop {
-# my ($kernel) = $_[KERNEL];
my ($kernel) = @_ ;
$kernel->delay_set('watch_for_new_jobs', $job_queue_loop_delay);
+ $kernel->delay_set('watch_for_done_jobs', $job_queue_loop_delay);
}
+sub watch_for_done_jobs {
+ my ($kernel,$heap) = @_[KERNEL, HEAP];
+
+ my $sql_statement = "SELECT * FROM ".$job_queue_tn.
+ " WHERE status='done'";
+ my $res = $job_db->select_dbentry( $sql_statement );
+
+ while( my ($id, $hit) = each %{$res} ) {
+ my $jobdb_id = $hit->{id};
+ my $sql_statement = "DELETE FROM $job_queue_tn WHERE id='$jobdb_id'";
+ my $res = $job_db->del_dbentry($sql_statement);
+ }
+
+ $kernel->delay_set('watch_for_done_jobs',$job_queue_loop_delay);
+}
sub watch_for_new_jobs {
my ($kernel,$heap) = @_[KERNEL, HEAP];
my $func_error = &send_msg_to_target($job_msg, $server_address, $GosaPackages_key, $header);
}
- $kernel->delay_set('watch_for_new_jobs',3);
+ $kernel->delay_set('watch_for_new_jobs', $job_queue_loop_delay);
}
next_task => \&next_task,
task_result => \&task_result,
watch_for_new_jobs => \&watch_for_new_jobs,
+ watch_for_done_jobs => \&watch_for_done_jobs,
create_packages_list_db => \&create_packages_list_db,
create_fai_server_db => \&create_fai_server_db,
}