Code

new column in jobdb 'progress'
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 21 Feb 2008 12:57:27 +0000 (12:57 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 21 Feb 2008 12:57:27 +0000 (12:57 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9016 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server
gosa-si/modules/GosaPackages.pm

index 4ea7bdbabe92a0f3b11276d6df567df426171ef9..2ffe6f7d09343c5489ac5f60ecc1caffc768d24a 100755 (executable)
@@ -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<\/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);
 
index 7e5eb63f5010a9921325181ea91f7581236fa37c..b0884efab047c6dbc393c0c91efca2fb8d5eb580 100644 (file)
@@ -378,6 +378,7 @@ sub process_job_msg {
             timestamp=>$timestamp,
             status=>'waiting', 
             result=>'none',
+            progress=>'none',
             headertag=>$header, 
             targettag=>$target,
             xmlmessage=>$msg,