Skip to content

Commit

Permalink
Disable cron stats
Browse files Browse the repository at this point in the history
  • Loading branch information
bbedward committed Mar 4, 2024
1 parent 1b6652d commit ea98e60
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions apps/server/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/cors"
"github.com/go-chi/httprate"
"github.com/go-co-op/gocron"
"github.com/google/uuid"
"github.com/joho/godotenv"
"k8s.io/klog/v2"
Expand Down Expand Up @@ -245,12 +244,12 @@ func runServer() {
}()

// Update stats and setup cron
repository.UpdateStats(paymentRepo, workRepo)
fmt.Println("🕒 Setting up cron...")
scheduler := gocron.NewScheduler(time.UTC)
scheduler.Every(10).Minutes().Do(func() {
repository.UpdateStats(paymentRepo, workRepo)
})
// repository.UpdateStats(paymentRepo, workRepo)
// fmt.Println("🕒 Setting up cron...")
// scheduler := gocron.NewScheduler(time.UTC)
// scheduler.Every(10).Minutes().Do(func() {
// repository.UpdateStats(paymentRepo, workRepo)
// })

fmt.Println("🚀 Starting server...")
log.Fatal(http.ListenAndServe(":"+port, router))
Expand Down

0 comments on commit ea98e60

Please sign in to comment.