feat: make watchdog itself configurable

This commit is contained in:
DaanSelen
2026-04-22 16:29:07 +02:00
parent ec3a996d6a
commit fa832bd1e0
12 changed files with 59 additions and 53 deletions
+1 -1
View File
@@ -1,9 +1,9 @@
package api
import (
"eden-server/internal/utility"
"fmt"
"log/slog"
"orbits-server/internal/utility"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
+6 -2
View File
@@ -1,9 +1,9 @@
package api
import (
"eden-server/internal/database"
"log/slog"
"net/http"
"orbits-server/internal/database"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
@@ -12,7 +12,7 @@ import (
func spawnApiRoutes(api *gin.RouterGroup /* env runtime.Environment,*/, db *gorm.DB) {
// prefix: api
// Display the information on what is going on at the moment
api.GET("/status", func(c *gin.Context) {
api.GET("/command", func(c *gin.Context) {
state, err := database.GetState(db)
if err != nil {
slog.Error("unable to determine state", "error", err)
@@ -28,6 +28,10 @@ func spawnApiRoutes(api *gin.RouterGroup /* env runtime.Environment,*/, db *gorm
})
})
api.PATCH("/command", func(c *gin.Context) {
})
// define a route to check what is registered
api.GET("/available", func(c *gin.Context) {
files, err := database.GetFiles(db)
+3 -3
View File
@@ -1,11 +1,11 @@
package api
import (
"eden-server/internal/database"
"eden-server/internal/utility"
"errors"
"log/slog"
"net/http"
"orbits-server/internal/database"
"orbits-server/internal/utility"
"path/filepath"
"github.com/gin-gonic/gin"
@@ -35,7 +35,7 @@ func spawnFileRoutes(file *gin.RouterGroup, env utility.Environment, db *gorm.DB
readerStream, err := f.Open()
if err != nil {
slog.Error("failed to open uploaded file in memory")
slog.Error("failed to a reader stream")
}
defer readerStream.Close()