From e4965e05b68bed4ebbde3330450bf477e05f1eaa Mon Sep 17 00:00:00 2001 From: augushong Date: Fri, 17 Jul 2026 23:33:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(timer):=20call=20=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=8A=A0=E5=BC=82=E5=B8=B8=E6=8D=95=E8=8E=B7?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=8D=95=E4=BB=BB=E5=8A=A1=E5=B4=A9=E6=BA=83?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- extend/base/common/command/TimerBase.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extend/base/common/command/TimerBase.php b/extend/base/common/command/TimerBase.php index ca7dd47..c182377 100644 --- a/extend/base/common/command/TimerBase.php +++ b/extend/base/common/command/TimerBase.php @@ -299,8 +299,13 @@ class TimerBase extends Command continue; } Cache::tag($cache_tag)->set($cache_key, time()); - call_user_func($call_item['target']); - $output->writeln(date('Y-m-d H:i:s') . ': call function ' . $name . ' finished'); + try { + call_user_func($call_item['target']); + $output->writeln(date('Y-m-d H:i:s') . ': call function ' . $name . ' finished'); + } catch (\Throwable $th) { + $output->writeln(date('Y-m-d H:i:s') . ': call function ' . $name . ' error: ' . $th->getMessage()); + Log::error('timer call [' . $name . '] error: ' . $th->getMessage()); + } } if ($input->hasOption('temp')) {