diff --git a/internal/store/tasks.go b/internal/store/tasks.go index 8e37258..57c5b51 100644 --- a/internal/store/tasks.go +++ b/internal/store/tasks.go @@ -246,7 +246,7 @@ func (s *Store) lookupTaskByExternalID(ctx context.Context, ext string) (Task, e // lookupLiveTaskByNorm finds the outstanding task with this normalised text. func (s *Store) lookupLiveTaskByNorm(ctx context.Context, norm string) (Task, error) { row := s.db.QueryRowContext(ctx, taskSelect+` - WHERE norm = ? AND status IN ('candidate','open')`, norm) + WHERE norm = ? AND status IN (?,?)`, norm, liveTaskStatuses[0], liveTaskStatuses[1]) t, err := scanTask(row) if errors.Is(err, sql.ErrNoRows) { return Task{}, ErrTaskNotFound