summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 924f80a)
raw | patch | inline | side by side (parent: 924f80a)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 28 Jan 2008 08:16:38 +0000 (08:16 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 28 Jan 2008 08:16:38 +0000 (08:16 +0000) |
Removed misplaced sleep.
Added checks.
Added another job.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8613 594d385d-05f5-0310-b6e9-bd551577e9d8
Added checks.
Added another job.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8613 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index c5fe3a1b4c8f265f876bd847963b87cbc550125b..c631b814e6d18a98280503026082caaa8aea3280 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
}
daemon_log("processing of msg finished", 5);
- sleep(10);
-
if (defined $answer) {
$heap->{client}->put($answer);
} else {
index 5f7fb0683bd8b61f9fefec360620a9c3784f6a0b..69dfe4e6c2f94a76fa815c0d1a54a15db3cd96a9 100644 (file)
use warnings;
use DBI;
use Data::Dumper;
+use GOSA::GosaSupportDaemon;
use threads;
use Time::HiRes qw(usleep);
my $lock = $self->{db_lock};
my $result=(-f $lock);
if($result) {
- #print STDERR "(".((defined $funcname)?$funcname:"").") Lock (PID ".$$.") $lock gefunden\n";
+ &main::daemon_log("(".((defined $funcname)?$funcname:"").") Lock (PID ".$$.") $lock gefunden", 6);
usleep 100;
}
return $result;
sub create_lock : locked {
my $self=shift;
my $funcname=shift;
- #print STDERR "(".((defined $funcname)?$funcname:"").") Erzeuge Lock (PID ".$$.") ".($self->{db_lock})."\n";
+ &main::daemon_log("(".((defined $funcname)?$funcname:"").") Erzeuge Lock (PID ".$$.") ".($self->{db_lock}),6);
my $lock = $self->{db_lock};
while( -f $lock ) {
- #print STDERR "(".((defined $funcname)?$funcname:"").") Lock (PID ".$$.") $lock gefunden\n";
+ print STDERR "(".((defined $funcname)?$funcname:"").") Lock (PID ".$$.") $lock gefunden\n";
sleep 1;
}
sub remove_lock : locked {
my $self=shift;
my $funcname=shift;
- #print STDERR "(".((defined $funcname)?$funcname:"").") Entferne Lock (PID ".$$.") ".$self->{db_lock}."\n";
+ &main::daemon_log("(".((defined $funcname)?$funcname:"").") Entferne Lock (PID ".$$.") ".$self->{db_lock}, 6);
close($self->{db_lock_handle});
unlink($self->{db_lock});
}
#&remove_lock($self,'show_table');
my $sql_statement= "SELECT * FROM $table_name ORDER BY timestamp";
+ &create_lock($self,'show_table');
my $res= &exec_statement($self, $sql_statement);
+ &remove_lock($self,'show_table');
my @answer;
foreach my $hit (@{$res}) {
my $answer= -1;
my $sql_statement= "SELECT * FROM $table";
+ &create_lock($self,'count_dbentries');
my $db_answer= &select_dbentry($self, $sql_statement);
+ &remove_lock($self, 'count_dbentries');
my $count = keys(%{$db_answer});
return $count;
}
-sub get_time {
- my ($seconds, $minutes, $hours, $monthday, $month,
- $year, $weekday, $yearday, $sommertime) = localtime(time);
- $hours = $hours < 10 ? $hours = "0".$hours : $hours;
- $minutes = $minutes < 10 ? $minutes = "0".$minutes : $minutes;
- $seconds = $seconds < 10 ? $seconds = "0".$seconds : $seconds;
- $month+=1;
- $month = $month < 10 ? $month = "0".$month : $month;
- $monthday = $monthday < 10 ? $monthday = "0".$monthday : $monthday;
- $year+=1900;
- return "$year$month$monthday$hours$minutes$seconds";
-}
-
-
1;
index 182e920bfc6236249b7b3ea95be4be1c8a04ea40..496ce8d4edb0d015cff3f794aef0bd5473bdfec4 100644 (file)
my $error= 0;
my $clause_str= "";
- if( not exists @{$msg_hash->{'where'}}[0]->{'clause'} ) { $error++; };
+ if( (not exists $msg_hash->{'where'}) || (not exists @{$msg_hash->{'where'}}[0]->{'clause'}) ) { $error++; };
if( $error == 0 ) {
my @clause_l;
my @where = @{@{$msg_hash->{'where'}}[0]->{'clause'}};
index e5590bd470f1b4aa9aa19d79cfefeea9147f41b7..b1231b04a1b63065de22a0b37581a6d7f4511177 100755 (executable)
--- a/gosa-si/tests/client.php
+++ b/gosa-si/tests/client.php
# query
#$data = "<xml><header>gosa_query_jobdb</header><where><clause><connector>and</connector><phrase><operator>gt</operator><ROWID>0</ROWID></phrase><phrase><operator>le</operator><ROWID>5</ROWID></phrase></clause></where></xml>";
#$data= "<xml><header>gosa_query_jobdb</header><where><clause><phrase><headertag>ping</headertag></phrase></clause></where><limit><from>0</from><to>3</to></limit></xml>";
-$data= "<xml><header>gosa_query_jobdb</header><where><clause><phrase><headertag>ping</headertag></phrase></clause></where><limit><from>0</from><to>5</to></limit><orderby>timestamp</orderby></xml>";
+#$data= "<xml><header>gosa_query_jobdb</header><where><clause><phrase><headertag>ping</headertag></phrase></clause></where><limit><from>0</from><to>5</to></limit><orderby>timestamp</orderby></xml>";
+$data= "<xml><header>gosa_query_jobdb</header></xml>";
# count