projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36da770
)
Task-Server mit SIGALRM sofort aufwecken können
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Wed, 8 Aug 2012 14:30:56 +0000
(16:30 +0200)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Wed, 8 Aug 2012 14:54:48 +0000
(16:54 +0200)
scripts/task_server.pl
patch
|
blob
|
history
diff --git
a/scripts/task_server.pl
b/scripts/task_server.pl
index
5854a51
..
1ac7e31
100755
(executable)
--- a/
scripts/task_server.pl
+++ b/
scripts/task_server.pl
@@
-123,7
+123,16
@@
sub gd_run {
}
my $seconds = 60 - (localtime)[0];
- sleep($seconds < 30 ? $seconds + 60 : $seconds);
+ if (!eval {
+ local $SIG{'ALRM'} = sub {
+ $::lxdebug->message(0, "Got woken up by SIGALRM") if $lx_office_conf{task_server}->{debug};
+ die "Alarm!\n"
+ };
+ sleep($seconds < 30 ? $seconds + 60 : $seconds);
+ 1;
+ }) {
+ die $@ unless $@ eq "Alarm!\n";
+ }
}
}