log: логировать каждый переход статуса задачи (task N: status "from" → "to")
All checks were successful
CI / test (push) Successful in 45s
CI / build-and-package (amd64, linux) (push) Successful in 41s
CI / build-and-package (amd64, windows) (push) Successful in 38s

This commit is contained in:
Hermes
2026-08-16 23:33:13 +05:00
parent 76ec7d21f1
commit 80c1097a72

View File

@@ -6,6 +6,7 @@ import (
"database/sql" "database/sql"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"log"
"time" "time"
) )
@@ -85,6 +86,7 @@ func (s *Storage) UpdateTask(ctx context.Context, t *Task) error {
if !IsValidTransition(oldStatus, t.Status) { if !IsValidTransition(oldStatus, t.Status) {
return fmt.Errorf("%w: %s → %s for task %d", ErrInvalidStatus, oldStatus, t.Status, t.ID) return fmt.Errorf("%w: %s → %s for task %d", ErrInvalidStatus, oldStatus, t.Status, t.ID)
} }
log.Printf("task %d: status %q → %q", t.ID, oldStatus, t.Status)
} else if t.Status == "" { } else if t.Status == "" {
t.Status = oldStatus t.Status = oldStatus
} }