From ea003a1e07034ac34bbd8032cffccdc35f132394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Sun, 29 Nov 2020 23:01:43 +0300 Subject: [PATCH] Updates for the terminal --- src/bb-modules/Cron/Service.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/bb-modules/Cron/Service.php b/src/bb-modules/Cron/Service.php index d19f5bc7b..8ba6dd2c8 100644 --- a/src/bb-modules/Cron/Service.php +++ b/src/bb-modules/Cron/Service.php @@ -10,7 +10,6 @@ * with this source code in the file LICENSE */ - namespace Box\Mod\Cron; class Service @@ -86,8 +85,12 @@ class Service { try { $api->{$method}($params); - } catch(\Exception $e) { - error_log($e); + } catch(Exception $e) { + throw new Exception($e); + } finally { + if (php_sapi_name() == 'cli') { + print ("\e[32mSuccessfully ran " . $method . "(" . $params . ")" . ".\e[0m\n"); + } } } @@ -107,4 +110,4 @@ class Service $t2 = new \DateTime('-6min'); return ($t1 < $t2); } -} \ No newline at end of file +}