mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 05:55:13 +00:00
swagger docs
This commit is contained in:
@@ -15,29 +15,31 @@ import (
|
||||
func main() {
|
||||
app := fiber.New()
|
||||
|
||||
app.Use(logger.New())
|
||||
|
||||
db := config.InitDB()
|
||||
|
||||
// Automatically fetch player stats on startup
|
||||
go func() {
|
||||
for season := 2020; season <= 2025; season++ {
|
||||
for season := 1993; season <= 2025; season++ {
|
||||
if err := services.FetchAndStorePlayerAdvancedStats(db, season); err != nil {
|
||||
log.Printf("Fetch failed for player advanced season %d: %v\n", season, err)
|
||||
} else {
|
||||
log.Printf("Fetch successful for player advanced season %d\n", season)
|
||||
}
|
||||
time.Sleep(2 * time.Second) // optional delay
|
||||
time.Sleep(1100 * time.Millisecond) // optional delay
|
||||
}
|
||||
log.Printf("player advanced Import Success")
|
||||
}()
|
||||
|
||||
go func() {
|
||||
for season := 2020; season <= 2025; season++ {
|
||||
for season := 1993; season <= 2025; season++ {
|
||||
if err := services.FetchAndStorePlayerTotalStats(db, season); err != nil {
|
||||
log.Printf("Fetch failed for player totals season %d: %v\n", season, err)
|
||||
} else {
|
||||
log.Printf("Fetch successful for player totals season %d\n", season)
|
||||
}
|
||||
time.Sleep(1 * time.Second) // optional delay
|
||||
time.Sleep(1000 * time.Millisecond) // optional delay
|
||||
}
|
||||
log.Printf("player totals Import Success")
|
||||
}()
|
||||
@@ -51,7 +53,5 @@ func main() {
|
||||
|
||||
app.Get("/swagger/*", fiberswagger.WrapHandler)
|
||||
|
||||
app.Use(logger.New())
|
||||
|
||||
app.Listen(":3001")
|
||||
}
|
||||
Reference in New Issue
Block a user