mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-30 20:55:32 +08:00
fix(timer): call 任务执行加异常捕获防止单任务崩溃定时器
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user