Merge pull request '[BUG] Add early-return to loading items from `SpecList`' (#4582) from gusted/forgejo-early-return into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4582 Reviewed-by: Beowulf <beowulf@noreply.codeberg.org> Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
commit
622479ef7f
|
@ -22,6 +22,10 @@ func (specs SpecList) GetScheduleIDs() []int64 {
|
|||
}
|
||||
|
||||
func (specs SpecList) LoadSchedules(ctx context.Context) error {
|
||||
if len(specs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
scheduleIDs := specs.GetScheduleIDs()
|
||||
schedules, err := GetSchedulesMapByIDs(ctx, scheduleIDs)
|
||||
if err != nil {
|
||||
|
@ -50,6 +54,10 @@ func (specs SpecList) GetRepoIDs() []int64 {
|
|||
}
|
||||
|
||||
func (specs SpecList) LoadRepos(ctx context.Context) error {
|
||||
if len(specs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
repoIDs := specs.GetRepoIDs()
|
||||
repos, err := repo_model.GetRepositoriesMapByIDs(ctx, repoIDs)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue