diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-10-09 16:34:12 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-10-09 16:34:12 +0300 |
| commit | a7c282ca348c1e8e60559e5c064caee28ba11eec (patch) | |
| tree | 43bd7bdb2bbc80b92b96a14b36c33f0b7df622c9 /rankings | |
| parent | Rankings page (diff) | |
| download | lphub-a7c282ca348c1e8e60559e5c064caee28ba11eec.tar.gz lphub-a7c282ca348c1e8e60559e5c064caee28ba11eec.tar.bz2 lphub-a7c282ca348c1e8e60559e5c064caee28ba11eec.zip | |
refactor: so much shit
Diffstat (limited to 'rankings')
| -rw-r--r-- | rankings/input/records.json | 8 | ||||
| -rw-r--r-- | rankings/main.go | 25 |
2 files changed, 15 insertions, 18 deletions
diff --git a/rankings/input/records.json b/rankings/input/records.json index 276310f..884fd49 100644 --- a/rankings/input/records.json +++ b/rankings/input/records.json | |||
| @@ -335,7 +335,7 @@ | |||
| 335 | "id": 47830, | 335 | "id": 47830, |
| 336 | "name": "Rat Maze", | 336 | "name": "Rat Maze", |
| 337 | "mode": 2, | 337 | "mode": 2, |
| 338 | "wr": 2 | 338 | "wr": 0 |
| 339 | }, | 339 | }, |
| 340 | { | 340 | { |
| 341 | "id": 45466, | 341 | "id": 45466, |
| @@ -401,7 +401,7 @@ | |||
| 401 | "id": 47847, | 401 | "id": 47847, |
| 402 | "name": "Cooperative Bridges", | 402 | "name": "Cooperative Bridges", |
| 403 | "mode": 2, | 403 | "mode": 2, |
| 404 | "wr": 3 | 404 | "wr": 2 |
| 405 | }, | 405 | }, |
| 406 | { | 406 | { |
| 407 | "id": 47850, | 407 | "id": 47850, |
| @@ -431,7 +431,7 @@ | |||
| 431 | "id": 47860, | 431 | "id": 47860, |
| 432 | "name": "Turret Walls", | 432 | "name": "Turret Walls", |
| 433 | "mode": 2, | 433 | "mode": 2, |
| 434 | "wr": 4 | 434 | "wr": 2 |
| 435 | }, | 435 | }, |
| 436 | { | 436 | { |
| 437 | "id": 52641, | 437 | "id": 52641, |
| @@ -509,7 +509,7 @@ | |||
| 509 | "id": 52712, | 509 | "id": 52712, |
| 510 | "name": "Double Bounce", | 510 | "name": "Double Bounce", |
| 511 | "mode": 2, | 511 | "mode": 2, |
| 512 | "wr": 2 | 512 | "wr": 0 |
| 513 | }, | 513 | }, |
| 514 | { | 514 | { |
| 515 | "id": 52713, | 515 | "id": 52713, |
diff --git a/rankings/main.go b/rankings/main.go index dfafb0c..70a25e9 100644 --- a/rankings/main.go +++ b/rankings/main.go | |||
| @@ -2,12 +2,8 @@ package main | |||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "log" | 4 | "log" |
| 5 | "os" | ||
| 6 | "os/signal" | ||
| 7 | "syscall" | ||
| 8 | 5 | ||
| 9 | "github.com/joho/godotenv" | 6 | "github.com/joho/godotenv" |
| 10 | "github.com/robfig/cron/v3" | ||
| 11 | ) | 7 | ) |
| 12 | 8 | ||
| 13 | func main() { | 9 | func main() { |
| @@ -15,16 +11,17 @@ func main() { | |||
| 15 | if err != nil { | 11 | if err != nil { |
| 16 | log.Fatalln("Error loading .env file:", err.Error()) | 12 | log.Fatalln("Error loading .env file:", err.Error()) |
| 17 | } | 13 | } |
| 18 | c := cron.New() | 14 | run() |
| 19 | _, err = c.AddFunc("0 0 * * *", run) | 15 | // c := cron.New() |
| 20 | if err != nil { | 16 | // _, err = c.AddFunc("0 0 * * *", run) |
| 21 | log.Fatalln("Error scheduling daily reminder:", err.Error()) | 17 | // if err != nil { |
| 22 | } | 18 | // log.Fatalln("Error scheduling daily reminder:", err.Error()) |
| 23 | c.Start() | 19 | // } |
| 24 | log.Println("ready for jobs") | 20 | // c.Start() |
| 25 | sc := make(chan os.Signal, 1) | 21 | // log.Println("ready for jobs") |
| 26 | signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) | 22 | // sc := make(chan os.Signal, 1) |
| 27 | <-sc | 23 | // signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) |
| 24 | // <-sc | ||
| 28 | } | 25 | } |
| 29 | 26 | ||
| 30 | func run() { | 27 | func run() { |