log: логировать каждый переход статуса задачи (task N: status "from" → "to")
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"database/sql"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -85,6 +86,7 @@ func (s *Storage) UpdateTask(ctx context.Context, t *Task) error {
|
||||
if !IsValidTransition(oldStatus, t.Status) {
|
||||
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 == "" {
|
||||
t.Status = oldStatus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user