|
|
@@ -77,9 +77,14 @@ func DiscoverDevice(ip string, deviceType models.DeviceType, username, password
|
|
|
// 获取命令列表
|
|
|
commands := parser.GetCommands()
|
|
|
|
|
|
- // 执行命令 - 允许部分命令失败,增加详细日志
|
|
|
+ // 执行命令 - 允许部分命令失败,增加详细日志和延迟防止设备速率限制
|
|
|
outputs := make([]string, 0, len(commands))
|
|
|
for i, cmd := range commands {
|
|
|
+ // 每个命令之间等待500毫秒,防止设备速率限制导致返回空数据
|
|
|
+ if i > 0 {
|
|
|
+ time.Sleep(500 * time.Millisecond)
|
|
|
+ }
|
|
|
+
|
|
|
fmt.Printf("[PARSER] Executing command %d/%d: %s\n", i+1, len(commands), cmd)
|
|
|
output, err := client.ExecuteCommand(cmd)
|
|
|
if err != nil {
|