fix(db): remove redundant GetCloseReason() calls (bd-bbh)

After adding close_reason column to issues table, two functions still
called GetCloseReason() to fetch from events table after already
scanning the column. Removed the redundant code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-01 22:06:08 -08:00
parent 09fffa4eaf
commit a4260c9660

View File

@@ -222,15 +222,6 @@ func (s *SQLiteStorage) GetIssue(ctx context.Context, id string) (*types.Issue,
}
issue.Labels = labels
// Fetch close reason if issue is closed
if issue.Status == types.StatusClosed {
closeReason, err := s.GetCloseReason(ctx, issue.ID)
if err != nil {
return nil, fmt.Errorf("failed to get close reason: %w", err)
}
issue.CloseReason = closeReason
}
return &issue, nil
}
@@ -376,15 +367,6 @@ func (s *SQLiteStorage) GetIssueByExternalRef(ctx context.Context, externalRef s
}
issue.Labels = labels
// Fetch close reason if issue is closed
if issue.Status == types.StatusClosed {
closeReason, err := s.GetCloseReason(ctx, issue.ID)
if err != nil {
return nil, fmt.Errorf("failed to get close reason: %w", err)
}
issue.CloseReason = closeReason
}
return &issue, nil
}