X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Ftask_server.pl;h=f6c8f59f378910ec0f59e96d566b7fa155c3e151;hb=04dccca70c47960cd6ea03a4f0ae05a9cbc42c41;hp=f11859b2b698d9e168a50224726c70f96517d650;hpb=4aa438985bc3b8d48c1350fe729c1ee25548b613;p=kivitendo-erp.git diff --git a/scripts/task_server.pl b/scripts/task_server.pl index f11859b2b..f6c8f59f3 100755 --- a/scripts/task_server.pl +++ b/scripts/task_server.pl @@ -25,7 +25,7 @@ use SL::Auth; use SL::DBUpgrade2; use SL::DB::AuthClient; use SL::DB::BackgroundJob; -use SL::BackgroundJob::ALL; +use SL::System::Process; use SL::Form; use SL::Helper::DateTime; use SL::InstanceConfiguration; @@ -262,7 +262,7 @@ sub run_single_job_for_all_clients { if (!$ok) { my $error = $EVAL_ERROR; - debug("Exception during execution: ${error}"); + $::lxdebug->message(LXDebug::WARN(), "Exception during execution: ${error}"); notify_on_failure(exception => $error); } @@ -308,7 +308,7 @@ sub run_once_for_all_clients { if (!$ok) { my $error = $EVAL_ERROR; - debug("Exception during execution: ${error}"); + $::lxdebug->message(LXDebug::WARN(), "Exception during execution: ${error}"); notify_on_failure(exception => $error); } @@ -321,6 +321,7 @@ sub gd_run { run_single_job_for_all_clients(); return; } + $::lxdebug->message(LXDebug::INFO(), "The task server for node " . SL::System::TaskServer::node_id() . " is up and running."); while (1) { $SIG{'ALRM'} = 'IGNORE'; @@ -331,6 +332,11 @@ sub gd_run { clean_before_sleeping(); + if (SL::System::Process::memory_usage_is_too_high()) { + debug("Memory usage too high - exiting."); + return; + } + my $seconds = 60 - (localtime)[0]; if (!eval { $SIG{'ALRM'} = sub {