From 9b2dd47669c8cfcea72fb7ad30d37f0f353abfbc Mon Sep 17 00:00:00 2001 From: Rocketcan Date: Tue, 22 Jul 2025 11:11:07 -0400 Subject: [PATCH] Fixed CreateCommands.go --- repository/CreateCommands.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/repository/CreateCommands.go b/repository/CreateCommands.go index 974d968..ce7ab82 100644 --- a/repository/CreateCommands.go +++ b/repository/CreateCommands.go @@ -421,11 +421,12 @@ func CreatePreDraftEventResultsBatch(db *gorm.DB, events []models.EventResults, func CreateCFBStandingsBatch(db *gorm.DB, standings []structs.CollegeStandings, batchSize int) error { total := len(standings) - end := i + batchSize - if end > total { + for i := 0; i < total; i += batchSize { + end := i + batchSize + if end > total { end = total } - if err := db.CreateInBatches(standings[i:end], batchSize).Error; err != nil { + if err := db.CreateInBatches(standings[i:end], batchSize).Error; err != nil { return err } }