mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
remove comments for old import
This commit is contained in:
@@ -17,7 +17,7 @@ func importPlayerAdvanced(db *gorm.DB) {
|
|||||||
}
|
}
|
||||||
log.Printf("Advanced import for season: %d", season)
|
log.Printf("Advanced import for season: %d", season)
|
||||||
time.Sleep(1100 * time.Millisecond)
|
time.Sleep(1100 * time.Millisecond)
|
||||||
utils.SleepWithJitter(1500 * time.Millisecond)
|
utils.SleepWithJitter(1000 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,30 +30,10 @@ func importPlayerAdvancedPlayoffs(db *gorm.DB) {
|
|||||||
}
|
}
|
||||||
log.Printf("Advanced Playoffs import for season: %d", season)
|
log.Printf("Advanced Playoffs import for season: %d", season)
|
||||||
time.Sleep(1100 * time.Millisecond)
|
time.Sleep(1100 * time.Millisecond)
|
||||||
utils.SleepWithJitter(1500 * time.Millisecond)
|
utils.SleepWithJitter(1250 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// importPlayerTotals fetches and stores regular-season total stats for seasons 2023–2025
|
|
||||||
// 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 2023–2024
|
|
||||||
// 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)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// importPlayerShotChart fetches shot-charts for every known player
|
// importPlayerShotChart fetches shot-charts for every known player
|
||||||
func importPlayerShotChart(db *gorm.DB) {
|
func importPlayerShotChart(db *gorm.DB) {
|
||||||
const firstID = "hardeja01"
|
const firstID = "hardeja01"
|
||||||
@@ -66,7 +46,7 @@ func importPlayerShotChart(db *gorm.DB) {
|
|||||||
|
|
||||||
// importPlayerTotalsScrape fetches & stores scraped regular-season total stats
|
// importPlayerTotalsScrape fetches & stores scraped regular-season total stats
|
||||||
func importPlayerTotalsScrape(db *gorm.DB) {
|
func importPlayerTotalsScrape(db *gorm.DB) {
|
||||||
for season := 2023; season <= 2025; season++ {
|
for season := 1993; season <= 2025; season++ {
|
||||||
if err := services.FetchAndStorePlayerTotalScrapedStats(db, season, false); err != nil {
|
if err := services.FetchAndStorePlayerTotalScrapedStats(db, season, false); err != nil {
|
||||||
log.Printf("scraped totals import failed for %d: %v", season, err)
|
log.Printf("scraped totals import failed for %d: %v", season, err)
|
||||||
}
|
}
|
||||||
@@ -78,12 +58,12 @@ func importPlayerTotalsScrape(db *gorm.DB) {
|
|||||||
|
|
||||||
// importPlayerPlayoffsScrape fetches & stores scraped playoff total stats
|
// importPlayerPlayoffsScrape fetches & stores scraped playoff total stats
|
||||||
func importPlayerTotalsPlayoffsScrape(db *gorm.DB) {
|
func importPlayerTotalsPlayoffsScrape(db *gorm.DB) {
|
||||||
for season := 2023; season <= 2025; season++ {
|
for season := 1993; season <= 2025; season++ {
|
||||||
if err := services.FetchAndStorePlayerTotalScrapedStats(db, season, true); err != nil {
|
if err := services.FetchAndStorePlayerTotalScrapedStats(db, season, true); err != nil {
|
||||||
log.Printf("scraped playoffs import failed for %d: %v", season, err)
|
log.Printf("scraped playoffs import failed for %d: %v", season, err)
|
||||||
}
|
}
|
||||||
log.Printf("Player Playoffs Totals import for season: %d", season)
|
log.Printf("Player Playoffs Totals import for season: %d", season)
|
||||||
time.Sleep(1500 * time.Millisecond)
|
time.Sleep(1100 * time.Millisecond)
|
||||||
utils.SleepWithJitter(1500 * time.Millisecond)
|
utils.SleepWithJitter(1750 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,10 +43,6 @@ func main() {
|
|||||||
importPlayerAdvancedPlayoffs(db)
|
importPlayerAdvancedPlayoffs(db)
|
||||||
log.Println("🎉 Player Advanced Playoffs Import completed successfully")
|
log.Println("🎉 Player Advanced Playoffs Import completed successfully")
|
||||||
|
|
||||||
// importPlayerTotals(db)
|
|
||||||
// log.Println("🎉 Player Totals Import completed successfully")
|
|
||||||
// importPlayerPlayoffs(db)
|
|
||||||
// log.Println("🎉 Player Totals Playoffs Import completed successfully")
|
|
||||||
|
|
||||||
importPlayerTotalsScrape(db)
|
importPlayerTotalsScrape(db)
|
||||||
log.Println("🎉 Player Totals (scraped) Import completed successfully")
|
log.Println("🎉 Player Totals (scraped) Import completed successfully")
|
||||||
@@ -57,7 +53,7 @@ func main() {
|
|||||||
// importPlayerShotChart(db)
|
// importPlayerShotChart(db)
|
||||||
// log.Println("🎉 Player Shot Chart Import Completed Successfully ")
|
// log.Println("🎉 Player Shot Chart Import Completed Successfully ")
|
||||||
|
|
||||||
log.Println("🎉 Import completed successfully")
|
log.Println("🏀 ALL Imports completed successfully ✅ 🙌")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user