Merge pull request #35 from nprasad2077/games

service workers adjust
This commit is contained in:
2025-07-17 00:44:27 -05:00
committed by GitHub
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -67,7 +67,7 @@ func importGameSchedules(db *gorm.DB) {
// "february", "march", "april", "may", "june", // "february", "march", "april", "may", "june",
} }
for season := 2018; season <= 2025; season++ { for season := 2025; season <= 2025; season++ {
log.Printf("--- Starting Game Schedule Import for Season: %d ---", season) log.Printf("--- Starting Game Schedule Import for Season: %d ---", season)
for _, month := range months { for _, month := range months {
// The service will print a warning and skip if a month has no data (e.g. May/June for a season not yet finished) // The service will print a warning and skip if a month has no data (e.g. May/June for a season not yet finished)
@@ -89,8 +89,8 @@ func importGameSchedules(db *gorm.DB) {
func importBoxScores(db *gorm.DB) { func importBoxScores(db *gorm.DB) {
// Define the date range for the 2023-2024 NBA season. // Define the date range for the 2023-2024 NBA season.
// The regular season typically starts in October and playoffs end in June. // The regular season typically starts in October and playoffs end in June.
from := time.Date(2023, time.October, 1, 0, 0, 0, 0, time.UTC) from := time.Date(2022, time.October, 1, 0, 0, 0, 0, time.UTC)
to := time.Date(2024, time.July, 1, 0, 0, 0, 0, time.UTC) to := time.Date(2023, time.July, 1, 0, 0, 0, 0, time.UTC)
log.Printf("--- Starting Box Score Data Import for the 2023-2024 Season ---") log.Printf("--- Starting Box Score Data Import for the 2023-2024 Season ---")
+1 -1
View File
@@ -16,7 +16,7 @@ import (
) )
const boxScoreURLBase = "https://www.basketball-reference.com" const boxScoreURLBase = "https://www.basketball-reference.com"
const numWorkers = 8 // Number of concurrent scrapers. Adjust based on your machine and network. const numWorkers = 5 // Number of concurrent scrapers. Adjust based on your machine and network.
// ScrapedResult holds all the parsed stats from a single game. // ScrapedResult holds all the parsed stats from a single game.
type ScrapedResult struct { type ScrapedResult struct {