progress output: show each operation fetch, bump 5.0.70

This commit is contained in:
“Naeel”
2026-07-16 14:07:02 +04:00
parent ce92ccb7de
commit 3591ea227a
3 changed files with 9 additions and 3 deletions
@@ -15,6 +15,7 @@ import (
"fmt"
"io"
"net/http"
"os"
"sort"
"strings"
"time"
@@ -154,11 +155,13 @@ func (c *Client) CollectOperations(ops []types.OperationInfo) ([]types.Operation
hasSuspend := false
hasResume := false
hasDelete := false
for _, op := range ops {
for i, op := range ops {
opName := normalize.OperationName(op.Operation)
if opName == "" {
continue
}
// Прогресс: выводим каждую операцию чтобы было видно что не зависло.
fmt.Fprintf(os.Stderr, " [%d/%d] %s (id=%d)...\n", i+1, len(ops), opName, op.SvcOperationID)
opInfo, err := c.GetServiceOperation(op.SvcOperationID)
if err != nil {
return nil, false, false, false, err
+4 -1
View File
@@ -47,9 +47,10 @@ func main() {
if svc.ID <= 0 {
continue
}
fmt.Fprintf(os.Stderr, " service %d (%s): fetching...\n", svc.ID, svc.Name)
info, err := cli.GetService(svc.ID)
if err != nil {
fmt.Fprintf(os.Stderr, "WARNING: service %d (%s) skipped: %v\n", svc.ID, svc.Name, err)
fmt.Fprintf(os.Stderr, " service %d (%s) skipped: %v\n", svc.ID, svc.Name, err)
continue
}
name := strings.TrimSpace(svc.Name)
@@ -64,6 +65,8 @@ func main() {
name = fmt.Sprintf("service_%d", svc.ID)
}
fmt.Fprintf(os.Stderr, " %d operations to fetch...\n", len(info.Operations))
ops, hasSuspend, _, _, err := cli.CollectOperations(info.Operations)
if err != nil {
panic(err)
+1 -1
View File
@@ -17,7 +17,7 @@ import (
)
var (
version string = "5.0.69"
version string = "5.0.70"
)
func main() {