From 38f166004ebaca64f8320a8ba19d39b9afba2166 Mon Sep 17 00:00:00 2001 From: tryforever Date: Mon, 19 Jun 2017 16:40:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1shell?= =?UTF-8?q?=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Autotask.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/index/controller/Autotask.php b/application/index/controller/Autotask.php index e2363274f..7c12a805d 100644 --- a/application/index/controller/Autotask.php +++ b/application/index/controller/Autotask.php @@ -62,7 +62,7 @@ class Autotask extends Controller if ($crontab['maximums'] && $crontab['executes'] > $crontab['maximums']) { //任务已超过最大执行次数 - $update['status'] = 'finished'; + $update['status'] = 'completed'; } else if ($crontab['endtime'] > 0 && $time > $crontab['endtime']) { @@ -83,7 +83,7 @@ class Autotask extends Controller { $update['executetime'] = $time; $update['executes'] = $crontab['executes'] + 1; - $update['status'] = ($crontab['maximums'] > 0 && $update['executes'] >= $crontab['maximums']) ? 'finished' : 'normal'; + $update['status'] = ($crontab['maximums'] > 0 && $update['executes'] >= $crontab['maximums']) ? 'completed' : 'normal'; } // 如果需要更新状态 @@ -118,7 +118,7 @@ class Autotask extends Controller else if ($crontab['type'] == 'shell') { // 执行Shell - exec('nohup php ' . $crontab['content'] . ' >> ' . $logDir . date("Y-m-d") . '.log 2>&1 &'); + exec( $crontab['content'] . ' >> ' . $logDir . date("Y-m-d") . '.log 2>&1 &'); } } catch (Exception $e) -- Gitee