]> git.frustrated-labs.net Git - squad-rotation-bot.git/commitdiff
feat: add sample crontab
authorAlexander Goussas <[email protected]>
Fri, 31 Oct 2025 02:16:36 +0000 (21:16 -0500)
committerAlexander Goussas <[email protected]>
Fri, 31 Oct 2025 03:04:39 +0000 (22:04 -0500)
main.go
scripts/crontab [new file with mode: 0644]

diff --git a/main.go b/main.go
index 80f5d3563c4f8392ad8e8fe6e8e8cfdcbd98ca2a..f2b5a21c5986d8dc69525bf8576d766896a7d8fe 100644 (file)
--- 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 (file)
index 0000000..7357771
--- /dev/null
@@ -0,0 +1 @@
+0 7 * * 1-5