mirror of
https://github.com/black-ant/Ant-Browser.git
synced 2026-07-14 18:48:55 +08:00
channel: master
version: 1.2.0
source-ref: D:\code\open_source\ant-chrome master
source-commit: f3d7ec5
merged-public-base: 3d264eb
24 lines
551 B
Go
24 lines
551 B
Go
package automation
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
func (m *Manager) SelfCheck(ctx context.Context) (RuntimeCheckResult, error) {
|
|
state := m.CurrentState()
|
|
if !state.Ready {
|
|
return RuntimeCheckResult{}, fmt.Errorf("自动化运行时尚未就绪")
|
|
}
|
|
if ctx == nil {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
result, err := m.verifyNodeWithPlaywright(ctx, state.NodePath, state.RuntimeDir)
|
|
if err != nil {
|
|
return RuntimeCheckResult{}, fmt.Errorf("自动化运行时自检失败: %w", err)
|
|
}
|
|
result.NodeSource = state.NodeSource
|
|
return result, nil
|
|
}
|