From: rettenbe Date: Thu, 21 Feb 2008 12:57:27 +0000 (+0000) Subject: new column in jobdb 'progress' X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b6590a274d8277d91bb1d373eec164e6c8d4627d;p=gosa.git new column in jobdb 'progress' git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9016 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 4ea7bdbab..2ffe6f7d0 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -851,7 +851,7 @@ sub send_msg_to_target { } } - return; + return $error; } @@ -1089,21 +1089,31 @@ sub watch_for_new_jobs { # add sqlite_id $job_msg =~ s/<\/xml>$/$jobdb_id<\/jobdb_id><\/xml>/; - &send_msg_to_target($job_msg, $server_address, $GosaPackages_key, $header); + my $func_error = &send_msg_to_target($job_msg, $server_address, $GosaPackages_key, $header); -# my $error = 1; -# if ($error == 0) { -# my $sql_statement = "UPDATE $job_queue_table_name ". -# "SET status='done', targettag='$target' ". +# if ( $func_error ) { +#print STDERR "========================================\n"; +#print STDERR "func_error: $func_error\n"; +# +# my $sql_statement = "UPDATE $job_queue_table_name ". +# "SET status='error', targettag='$target' ". # "WHERE id='$jobdb_id'"; -# my $res = $job_db->update_dbentry($sql_statement); -# } else { -# my $sql_statement = "UPDATE $job_queue_table_name ". -# "SET status='error' ". +#print STDERR "sql: $sql_statement\n"; +# my $res = $job_db->update_dbentry($sql_statement); +#print STDERR "res: ".Dumper($res); +# +# } else { +#print STDERR "========================================\n"; +#print STDERR "func_error: $func_error\n"; +# +# my $sql_statement = "UPDATE $job_queue_table_name ". +# "SET status='done', targettag='$target' ". # "WHERE id='$jobdb_id'"; -# my $res = $job_db->update_dbentry($sql_statement); -# } - } +#print STDERR "sql: $sql_statement\n"; +# my $res = $job_db->update_dbentry($sql_statement); +#print STDERR "res: ".Dumper($res); +# } + } $kernel->delay_set('watch_for_new_jobs',3); } @@ -1166,7 +1176,7 @@ if ($no_bus > 0) { #unlink('/tmp/gosa_si_lock*'); # connect to gosa-si job queue -my @job_col_names = ("id INTEGER", "timestamp", "status", "result", "headertag", "targettag", "xmlmessage", "macaddress"); +my @job_col_names = ("id INTEGER", "timestamp", "status", "result", "progress", "headertag", "targettag", "xmlmessage", "macaddress"); $job_db = GOSA::DBsqlite->new($job_queue_file_name); $job_db->create_table('jobs', \@job_col_names); diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index 7e5eb63f5..b0884efab 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -378,6 +378,7 @@ sub process_job_msg { timestamp=>$timestamp, status=>'waiting', result=>'none', + progress=>'none', headertag=>$header, targettag=>$target, xmlmessage=>$msg,