fix(timer): 自动记录执行日志并捕获结果

Add execute() wrapper in TimerControllerBase that wraps do() with logStart/logEnd, captures return value to result field. Change site URL routing from /do to /execute with task_name injection. Add result field to system_timer_log scheme.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
augushong
2026-05-26 18:28:36 +08:00
parent e1bf94a55e
commit a47bbb2c6a
4 changed files with 34 additions and 2 deletions

View File

@@ -119,10 +119,15 @@ class TimerServiceBase
'concurrency_id' => $i,
'concurrency_count' => $concurrency,
'host_id' => HostService::getNodeId(),
'task_name' => $config_item['name'],
];
// 处理target
if ($config_item['type'] == 'site') {
$target_info = parse_url($target);
// 将 /do 替换为 /execute用于日志包裹
if (isset($target_info['path'])) {
$target_info['path'] = preg_replace('#/do$#', '/execute', $target_info['path']);
}
$query_params = [];
if (isset($target_info['query'])) {
parse_str($target_info['query'], $query_params);