task_server.pl: Speicherlimit beachten
[kivitendo-erp.git] / scripts / task_server.pl
index f11859b..2f3339c 100755 (executable)
@@ -25,6 +25,7 @@ use SL::Auth;
 use SL::DBUpgrade2;
 use SL::DB::AuthClient;
 use SL::DB::BackgroundJob;
+use SL::Dispatcher;
 use SL::BackgroundJob::ALL;
 use SL::Form;
 use SL::Helper::DateTime;
@@ -331,6 +332,10 @@ sub gd_run {
 
     clean_before_sleeping();
 
+    if (SL::Dispatcher::_memory_usage_is_too_high()) {
+      return;
+    }
+
     my $seconds = 60 - (localtime)[0];
     if (!eval {
       $SIG{'ALRM'} = sub {