feat: add locally syncing and watchdog

This commit is contained in:
DaanSelen
2026-04-22 15:26:59 +02:00
parent 0c287cc917
commit ec3a996d6a
12 changed files with 283 additions and 179 deletions
+4 -2
View File
@@ -17,6 +17,8 @@ func main() {
slog.Info("grabbing environment variables")
env := utility.GrabEnvironment()
// TO DO, allow cmd args parsing
// checking directories to ensure its expected environment is ready
slog.Info("auditing operating environment")
if err := utility.EnsureOperation(env.DataDirectory); err != nil {
@@ -29,10 +31,10 @@ func main() {
slog.Info("kicking off database connection")
db, err := database.KickoffDatabase(env.DataDirectory)
if err != nil {
slog.Error("failed to initiate a database connection")
slog.Error("failed to initiate a database connection", "error", err)
os.Exit(1)
}
slog.Info("kicking off database watchdog", "watch_interval", env.WatchInterval)
slog.Info("kicking off database watchdog", "watch_interval", env.WatchdogInterval)
database.KickoffDatabaseWatchdog(env, db)
// TO DO make gin log as json