From 70624a9de07abeaf44e5fdf2bdd33b93e264a287 Mon Sep 17 00:00:00 2001 From: Alexander Goussas Date: Thu, 30 Oct 2025 21:16:36 -0500 Subject: [PATCH] feat: add sample crontab --- main.go | 3 +++ scripts/crontab | 1 + 2 files changed, 4 insertions(+) create mode 100644 scripts/crontab diff --git a/main.go b/main.go index 80f5d35..f2b5a21 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,7 @@ func connectDB(dbUrl string) *pgx.Conn { if attempts == 2 { log.Fatalf("There was an error while trying to connect to the database: %s", err) } + log.Printf("Failed to connect to database, retrying in 3 seconds...") time.Sleep(3 * time.Second) } @@ -58,6 +59,8 @@ func main() { if messagingService.SendRotationNotification(chosenOne) != nil { log.Fatalf("There was an error while trying to send a rotation: %s", err) } + + log.Printf("Succesfully sent rotation update: %s", chosenOne.FullName) }) http.ListenAndServe(":8080", nil) diff --git a/scripts/crontab b/scripts/crontab new file mode 100644 index 0000000..7357771 --- /dev/null +++ b/scripts/crontab @@ -0,0 +1 @@ +0 7 * * 1-5 -- 2.43.0