From bcacf008b08b828cf525883be2506006ccb7bfe9 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 5 Oct 2022 23:33:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=BC=BA=E5=88=B6=E5=81=9C=E6=AD=A2=20issues?= =?UTF-8?q?#62?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/Task.php | 9 +++++++-- public/page/crontab.html | 22 +++++++++++++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/app/controller/Task.php b/app/controller/Task.php index d8b3a11..50afded 100644 --- a/app/controller/Task.php +++ b/app/controller/Task.php @@ -94,8 +94,13 @@ class Task extends BaseController { $rs = self::RS; $uuid = $request->get('uuid'); - //TODO... - return json(domainReseed::parser($uuid)); + $pid_file = Crontab::getPidFile($uuid); + clearstatcache(); + $rs['data'] = [ + 'success' => (is_file($pid_file) and unlink($pid_file)) or !is_file($pid_file), + ]; + + return json($rs); } /** diff --git a/public/page/crontab.html b/public/page/crontab.html index dae505f..0b17de7 100644 --- a/public/page/crontab.html +++ b/public/page/crontab.html @@ -388,6 +388,7 @@