feat: make watchdog itself configurable
This commit is contained in:
+11
-5
@@ -1,10 +1,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"eden-server/internal/api"
|
||||
"eden-server/internal/database"
|
||||
"eden-server/internal/utility"
|
||||
"log/slog"
|
||||
"orbits-server/internal/api"
|
||||
"orbits-server/internal/database"
|
||||
"orbits-server/internal/utility"
|
||||
"os"
|
||||
)
|
||||
|
||||
@@ -34,8 +34,14 @@ func main() {
|
||||
slog.Error("failed to initiate a database connection", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
slog.Info("kicking off database watchdog", "watch_interval", env.WatchdogInterval)
|
||||
database.KickoffDatabaseWatchdog(env, db)
|
||||
|
||||
// kick off the watchdog depending on the environment variables
|
||||
if env.WatchdogEnabled {
|
||||
slog.Info("kicking off database watchdog", "watchdog_interval", env.WatchdogInterval)
|
||||
database.KickoffDatabaseWatchdog(env, db)
|
||||
} else {
|
||||
slog.Info("skipping database watchdog", "watchdog_enabled", env.WatchdogEnabled)
|
||||
}
|
||||
|
||||
// TO DO make gin log as json
|
||||
// get ready to kick off the http api with Vue frontend
|
||||
|
||||
Reference in New Issue
Block a user