From: Alexander Goussas Date: Fri, 31 Oct 2025 02:16:36 +0000 (-0500) Subject: feat: add sample crontab X-Git-Url: http://git.frustrated-labs.net/?a=commitdiff_plain;h=70624a9de07abeaf44e5fdf2bdd33b93e264a287;p=squad-rotation-bot.git feat: add sample 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