Cleanup Service

* Updated .env
+ Implemented automatical removal of old logs
This commit is contained in:
2024-01-21 21:42:58 +02:00
parent 92baa56a1c
commit f3905bb822
6 changed files with 104 additions and 28 deletions

View File

@@ -13,6 +13,7 @@ import (
func setupApi(r *gin.Engine) {
api := r.Group("/api/v1")
// Fetch the chart image for the disk's temperature
api.GET("/disks/:diskid/chart", func(ctx *gin.Context) {
diskIDString := ctx.Param("diskid")
diskId, err := strconv.Atoi(diskIDString)
@@ -51,6 +52,7 @@ func setupApi(r *gin.Engine) {
}
})
// Get a list of all the disks
api.GET("/disks", func(ctx *gin.Context) {
olderThan := time.Now().Add(time.Minute * time.Duration(10) * -1)