fix(core): /retry чистит postmortem-трассы — на новом прогоне постмортем запускается заново
This commit is contained in:
@@ -107,6 +107,17 @@ func (s *Storage) GetLatestTrace(ctx context.Context, taskID int64, agent string
|
||||
return tr, nil
|
||||
}
|
||||
|
||||
// DeleteTracesByAgent удаляет все трассы задачи с заданным агентом
|
||||
// (сброс маркера при /retry N: чистый перезапуск без наследия анализа).
|
||||
func (s *Storage) DeleteTracesByAgent(ctx context.Context, taskID int64, agent string) error {
|
||||
_, err := s.db.ExecContext(ctx,
|
||||
`DELETE FROM traces WHERE task_id=? AND agent=?`, taskID, agent)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%w: delete traces agent %s for task %d: %w", ErrDB, agent, taskID, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteTrace удаляет трассу. Только для тестов/админки.
|
||||
func (s *Storage) DeleteTrace(ctx context.Context, id int64) error {
|
||||
res, err := s.db.ExecContext(ctx, `DELETE FROM traces WHERE id = ?`, id)
|
||||
|
||||
Reference in New Issue
Block a user