diff options
| author | Jan Wolff <janw@mailbox.org> | 2025-09-12 10:17:45 +0200 |
|---|---|---|
| committer | Jan Wolff <janw@mailbox.org> | 2025-09-12 10:17:45 +0200 |
| commit | 154abc0c5016635ad3af49a0772a97fbdc34bedb (patch) | |
| tree | ef8a548496584b9045be72a5cbf1ad41ee4498b6 /controller/app.go | |
| parent | 283c31564a9d5dab4b8b71d7498886b0cd20a999 (diff) | |
qrcode, automated cleanup
Diffstat (limited to 'controller/app.go')
| -rw-r--r-- | controller/app.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/controller/app.go b/controller/app.go index f145ce2..c22f165 100644 --- a/controller/app.go +++ b/controller/app.go @@ -3,7 +3,9 @@ package controller import ( "embed" "html/template" + "log" "net/http" + "time" "drop.janw.name/config" "drop.janw.name/storage" @@ -37,3 +39,16 @@ func (app App) requireAuth(res http.ResponseWriter, req *http.Request) bool { return false } + +func (app *App) StartScheduler() { + log.Println("starting scheduler") + + go func() { + for true { + time.Sleep(time.Minute * 13) + + log.Println("running scheduled tasks") + app.storage.GarbageCollect() + } + }() +} |
