Purge old expired sessions

This commit is contained in:
William Bouzourène 2025-01-21 15:59:51 +01:00
parent 93b464b0ff
commit c577facc24
3 changed files with 75 additions and 0 deletions

View file

@ -5,9 +5,11 @@ import (
"fmt"
"io/fs"
"net/http"
"time"
"git.readonly.ch/bouzoure/pop-camarades/controllers"
"git.readonly.ch/bouzoure/pop-camarades/helpers"
"git.readonly.ch/bouzoure/pop-camarades/jobs"
"git.readonly.ch/bouzoure/pop-camarades/middlewares"
"github.com/flosch/pongo2/v6"
"github.com/gofiber/fiber/v2"
@ -43,6 +45,9 @@ func main() {
}
}
// RegisterJobs
go helpers.RegisterJob(60*time.Minute, "clean saved sessions", jobs.CleanSavedSessions)
// Create a new engine
var engine *django.Engine
if config.Debug {