diff options
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() + } + }() +} |
