From 8bc170f7db189d2019069f2a614c3e899cd49fb2 Mon Sep 17 00:00:00 2001 From: CalebRose Date: Wed, 13 May 2026 09:35:04 -0700 Subject: [PATCH] adding gameplan data to schedule bootstrap --- managers/BootstrapManager.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/managers/BootstrapManager.go b/managers/BootstrapManager.go index ace52c8..f52e99f 100644 --- a/managers/BootstrapManager.go +++ b/managers/BootstrapManager.go @@ -80,6 +80,8 @@ type BootstrapDataScheduling struct { Stadiums []structs.Stadium CFBGameRequests []structs.CFBGameRequest NFLGameRequests []structs.NFLGameRequest + CollegeGameplanMap map[uint]structs.CollegeGameplan + NFLGameplanMap map[uint]structs.NFLGameplan } type BootstrapDataDraft struct { @@ -455,9 +457,11 @@ func GetSchedulePageBootstrap(username, collegeID, seasonID string) BootstrapDat stadiums []structs.Stadium cfbGameRequests []structs.CFBGameRequest nflGameRequests []structs.NFLGameRequest + cfbGameplanMap map[uint]structs.CollegeGameplan + nflGameplanMap map[uint]structs.NFLGameplan ) if len(collegeID) > 0 && collegeID != "0" { - wg.Add(4) + wg.Add(5) go func() { defer wg.Done() officialPolls = GetAllOfficialPolls() @@ -474,8 +478,13 @@ func GetSchedulePageBootstrap(username, collegeID, seasonID string) BootstrapDat defer wg.Done() cfbGameRequests = repository.FindCFBGameRequestRecords(repository.SchedulerQuery{SeasonID: seasonID}) }() + go func() { + defer wg.Done() + gameplans := GetAllCollegeGameplans() + cfbGameplanMap = MakeCollegeGameplanMap(gameplans) + }() } - wg.Add(3) + wg.Add(4) go func() { defer wg.Done() log.Println("Fetching Retired Players...") @@ -494,6 +503,11 @@ func GetSchedulePageBootstrap(username, collegeID, seasonID string) BootstrapDat nflGameRequests = repository.FindNFLGameRequestRecords(repository.SchedulerQuery{SeasonID: seasonID}) log.Println("Fetched NFL Game Requests, count:", len(nflGameRequests)) }() + go func() { + defer wg.Done() + gameplans := GetAllNFLGameplans() + nflGameplanMap = MakeNFLGameplanMap(gameplans) + }() wg.Wait() return BootstrapDataScheduling{ @@ -504,6 +518,8 @@ func GetSchedulePageBootstrap(username, collegeID, seasonID string) BootstrapDat Stadiums: stadiums, CFBGameRequests: cfbGameRequests, NFLGameRequests: nflGameRequests, + CollegeGameplanMap: cfbGameplanMap, + NFLGameplanMap: nflGameplanMap, } }