1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-28 13:49:13 -05:00

Merge pull request '[v8.0/forgejo] [BUG] Add early-return to loading items from SpecList' (#4585) from bp-v8.0/forgejo-f7dac2c into v8.0/forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4585
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-07-20 08:30:09 +00:00
commit 57e69e56b4

View file

@ -22,6 +22,10 @@ func (specs SpecList) GetScheduleIDs() []int64 {
} }
func (specs SpecList) LoadSchedules(ctx context.Context) error { func (specs SpecList) LoadSchedules(ctx context.Context) error {
if len(specs) == 0 {
return nil
}
scheduleIDs := specs.GetScheduleIDs() scheduleIDs := specs.GetScheduleIDs()
schedules, err := GetSchedulesMapByIDs(ctx, scheduleIDs) schedules, err := GetSchedulesMapByIDs(ctx, scheduleIDs)
if err != nil { if err != nil {
@ -50,6 +54,10 @@ func (specs SpecList) GetRepoIDs() []int64 {
} }
func (specs SpecList) LoadRepos(ctx context.Context) error { func (specs SpecList) LoadRepos(ctx context.Context) error {
if len(specs) == 0 {
return nil
}
repoIDs := specs.GetRepoIDs() repoIDs := specs.GetRepoIDs()
repos, err := repo_model.GetRepositoriesMapByIDs(ctx, repoIDs) repos, err := repo_model.GetRepositoriesMapByIDs(ctx, repoIDs)
if err != nil { if err != nil {