summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 779dc72)
raw | patch | inline | side by side (parent: 779dc72)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Apr 2008 16:31:02 +0000 (16:31 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Apr 2008 16:31:02 +0000 (16:31 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10258 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 657f40e37e5b477aa50c6f57906038eef61049d1..f32876de249626da6504a833e860ad5998bb644e 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
}
}
}
-
+
# Commit deletion
$job_db->exec_statementlist(\@drops);
# Look for new jobs that could be executed
foreach my $macaddress (keys %{$hits}) {
+
+ # Look if there is an executing job
+ my $sql_statement = "SELECT * FROM $job_queue_tn WHERE macaddress LIKE '$macaddress' AND status='processing'";
+ my $res = $job_db->exec_statement( $sql_statement );
+
+ # Skip new jobs for host if there is a processing job
+ if(defined($res) and defined @{$res}[0]) {
+ next;
+ }
+
foreach my $jobdb_headertag (keys %{$hits->{$macaddress}}) {
my $jobdb_id = @{$hits->{$macaddress}->{$jobdb_headertag}}[0];
my $job_msg = @{$hits->{$macaddress}->{$jobdb_headertag}}[7];
- daemon_log("J DEBUG: its time to execute $job_msg", 7);
+ daemon_log("J DEBUG: its time to execute $job_msg", 7);
my $sql_statement = "SELECT * FROM known_clients WHERE macaddress LIKE '$macaddress'";
my $res_hash = $known_clients_db->select_dbentry( $sql_statement );
# change header
$job_msg =~ s/<header>job_/<header>gosa_/;
- # add sqlite_id
+ # add sqlite_id
$job_msg =~ s/<\/xml>$/<jobdb_id>$jobdb_id<\/jobdb_id><\/xml>/;
$job_msg =~ /<header>(\S+)<\/header>/;
# update status in job queue to 'processing'
$sql_statement = "UPDATE $job_queue_tn SET status='processing' WHERE id='$jobdb_id'";
my $res = $job_db->update_dbentry($sql_statement);
+
+ # We don't want parallel processing
+ last;
}
}