docker fixes

This commit is contained in:
Ravi Prasad
2025-05-08 19:20:55 -05:00
parent 992ec88a41
commit 2ee23ad0f2
4 changed files with 79 additions and 59 deletions
+39
View File
@@ -0,0 +1,39 @@
package main
import (
"log"
"time"
"gorm.io/gorm"
"github.com/nprasad2077/NBA_Go/services"
)
// importPlayerAdvanced fetches and stores advanced stats for seasons 20232025
func importPlayerAdvanced(db *gorm.DB) {
for season := 2023; season <= 2025; season++ {
if err := services.FetchAndStorePlayerAdvancedStats(db, season); err != nil {
log.Printf("advanced import failed for %d: %v", season, err)
}
time.Sleep(1100 * time.Millisecond)
}
}
// importPlayerTotals fetches and stores regular-season total stats for seasons 20232025
func importPlayerTotals(db *gorm.DB) {
for season := 2023; season <= 2025; season++ {
if err := services.FetchAndStorePlayerTotalStats(db, season, false); err != nil {
log.Printf("totals import failed for %d: %v", season, err)
}
time.Sleep(1000 * time.Millisecond)
}
}
// importPlayerPlayoffs fetches and stores playoff total stats for seasons 20232024
func importPlayerPlayoffs(db *gorm.DB) {
for season := 2023; season <= 2024; season++ {
if err := services.FetchAndStorePlayerTotalPlayoffsStats(db, season, true); err != nil {
log.Printf("playoffs import failed for %d: %v", season, err)
}
time.Sleep(1500 * time.Millisecond)
}
}