From: Sven Schöling Date: Wed, 8 Aug 2012 15:48:29 +0000 (+0200) Subject: Merge branch 'master' of vc.linet-services.de:public/lx-office-erp X-Git-Tag: release-3.0.0beta1~297^2~17 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/commitdiff_plain/4ab897fdb1a54cd753ec66ebc8fbd5ffdd883cd6?hp=-c Merge branch 'master' of vc.linet-services.de:public/lx-office-erp --- 4ab897fdb1a54cd753ec66ebc8fbd5ffdd883cd6 diff --combined scripts/task_server.pl index 2c4a05fd4,f438b7410..8c17ca70a --- a/scripts/task_server.pl +++ b/scripts/task_server.pl @@@ -27,7 -27,6 +27,7 @@@ use SL::DB::BackgroundJob use SL::BackgroundJob::ALL; use SL::Form; use SL::Helper::DateTime; +use SL::InstanceConfiguration; use SL::LXDebug; use SL::LxOfficeConf; use SL::Locale; @@@ -39,12 -38,11 +39,12 @@@ sub lxinit package main; - $::lxdebug = LXDebug->new; - $::locale = Locale->new($::lx_office_conf{system}->{language}); - $::form = Form->new; - $::auth = SL::Auth->new; - $::request = { cgi => CGI->new({}) }; + $::lxdebug = LXDebug->new; + $::locale = Locale->new($::lx_office_conf{system}->{language}); + $::form = Form->new; + $::auth = SL::Auth->new; + $::instance_conf = SL::InstanceConfiguration->new; + $::request = { cgi => CGI->new({}) }; die 'cannot reach auth db' unless $::auth->session_tables_present; @@@ -125,7 -123,16 +125,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"; + } } } @@@ -136,7 -143,7 +145,7 @@@ mkdir($pidbase) if !-d $pidbase my $file = -f "${cwd}/config/lx_office.conf" ? "${cwd}/config/lx_office.conf" : "${cwd}/config/lx_office.conf.default"; newdaemon(configfile => $file, - progname => 'lx-office-task-server', + progname => 'kivitendo-task-server', pidbase => "${pidbase}/", );