diff --git a/cron.php b/cron.php index 51b36ab..18598f2 100644 --- a/cron.php +++ b/cron.php @@ -127,12 +127,18 @@ function run__cronjobs_filter_job($software, $instance, $filter, $action) { $jobname = $action['action']['name'].'_'.$user['id']; $jobmod = 'api/v1/http/'.$software.'/accounts/'.$action['action']['name']; $report = '[automatic_report] User has been reported because it matches filter "'.$filter['preset_name'].'"'; + $explain = $report; + if (isset($action['action']['explain'])) + $explain = $action['action']['explain']; $args = base64_encode(json_encode([ '_get' => [ 'id' => $user['id'], 'instance' => $instance, ], - '_post' => ['report' => $report ], + '_post' => [ + 'report' => $report, + 'explain' => $explain, + ], ])); $_POST = [ 'name' => $jobname, @@ -187,6 +193,8 @@ function run_cronjobs() { $max = 1000; if (isset($GLOBALS['appconf']['cron__max_jobs'])) $max = intval($GLOBALS['appconf']['cron__max_jobs']); + if (getenv('MAX_JOBS') !== false) + $max = intval(getenv('MAX_JOBS')); $_GET = ['max' => $max]; $jobs = mod_php('api/v1/cron/jobs'); foreach ($jobs as $job) {