From: rettenbe Date: Tue, 18 Mar 2008 17:10:20 +0000 (+0000) Subject: vanishing jobs after TASKEND softupdate 0 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0e54e9677a9111eb179e4d45c89dacc2353d2a8d;p=gosa.git vanishing jobs after TASKEND softupdate 0 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9933 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index 7c396167d..b616de5ba 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -276,16 +276,6 @@ sub process_incoming_msg { } foreach my $out_msg ( @msg_l ) { - -# # keep job queue up-to-date and save result and status -# if (defined ($out_msg) && $out_msg =~ /(\d+)<\/jobdb_id>/) { -# my $job_id = $1; -# my $sql = "UPDATE '".$main::job_queue_tn."'". -# " SET status='processing'". -# " WHERE id='$job_id'"; -# my $res = $main::job_db->exec_statement($sql); -# } - # substitute in all outgoing msg GOSA of $server_address $out_msg =~ s/GOSA<\/source>/$server_address<\/source>/g; $out_msg =~ s/<\/xml>/$session_id<\/session_id><\/xml>/; @@ -314,17 +304,6 @@ sub process_gosa_msg { @out_msg_l = &{$event_hash->{$header}."::$header"}($msg, $msg_hash, $session_id); } - # if incoming 'gosa_'-msg is scheduled from job_queue, than it contains xml-tag 'jobdb_id' - # after procesing this msg, set status of this job in job_queue to done -# if ($msg =~ /(\d+)<\/jobdb_id>/) { -# my $sql_statement = "UPDATE $main::job_queue_tn ". -# "SET status='done' ". -# "WHERE id='$1'"; -# &main::daemon_log("DEBUG: $sql_statement", 7); -# my $res = $main::job_db->update_dbentry($sql_statement); -# &main::daemon_log("INFO: set job '$1' to status 'done'", 5); -# } - # if delivery not possible raise error and return if( not defined $out_msg_l[0] ) { # &main::daemon_log("WARNING: GosaPackages got no answer from event handler '$header'", 3); diff --git a/gosa-si/server/events/clMessages.pm b/gosa-si/server/events/clMessages.pm index 23b302282..698dad28e 100644 --- a/gosa-si/server/events/clMessages.pm +++ b/gosa-si/server/events/clMessages.pm @@ -417,13 +417,22 @@ sub TASKEND { # clean up header $header =~ s/CLMSG_//g; - my $sql_statement = "UPDATE $main::job_queue_tn ". - "SET status='processing', result='$header "."$content' ". - "WHERE status='processing' AND macaddress LIKE '$macaddress'"; - &main::daemon_log("$session_id DEBUG: $sql_statement", 7); - my $res = $main::job_db->update_dbentry($sql_statement); - &main::daemon_log("$session_id INFO: $header at '$macaddress' - '$content'", 5); + if ($header eq "TASKEND softupdate 0") { + &main::daemon_log("$session_id DEBUG: softupdate at host '$source' successful", 7); + my $sql_statement = "DELETE FROM $main::job_queue_tn WHERE status='processing' AND macaddress LIKE '$macaddress'"; + &main::daemon_log("$session_id DEBUG: $sql_statement", 7); + my $res = $main::job_db->del_dbentry($sql_statement); + + } else { + + my $sql_statement = "UPDATE $main::job_queue_tn ". + "SET status='processing', result='$header "."$content' ". + "WHERE status='processing' AND macaddress LIKE '$macaddress'"; + &main::daemon_log("$session_id DEBUG: $sql_statement", 7); + my $res = $main::job_db->update_dbentry($sql_statement); + &main::daemon_log("$session_id INFO: $header at '$macaddress' - '$content'", 5); + } # -----------------------> Update hier # finish #
CLMSG_TASKBEGIN