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:
@@ -222,15 +222,6 @@ func (s *SQLiteStorage) GetIssue(ctx context.Context, id string) (*types.Issue,
|
|||||||
}
|
}
|
||||||
issue.Labels = labels
|
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
|
return &issue, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,15 +367,6 @@ func (s *SQLiteStorage) GetIssueByExternalRef(ctx context.Context, externalRef s
|
|||||||
}
|
}
|
||||||
issue.Labels = labels
|
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
|
return &issue, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user