Add cron tasks to distillery

This commit is contained in:
Tom Wiesing 2022-12-07 10:30:48 +01:00
parent 790460f9de
commit f52fe6abf3
No known key found for this signature in database
19 changed files with 353 additions and 141 deletions

View file

@ -3,9 +3,7 @@ package home
import (
"context"
"fmt"
"io"
"net/http"
"time"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/instances"
@ -17,8 +15,6 @@ type Home struct {
Instances *instances.Instances
RefreshInterval time.Duration
redirect lazy.Lazy[*Redirect]
instanceNames lazy.Lazy[map[string]struct{}]
homeBytes lazy.Lazy[[]byte]
@ -30,10 +26,7 @@ var (
func (*Home) Routes() []string { return []string{"/"} }
func (home *Home) Handler(ctx context.Context, route string, progress io.Writer) (http.Handler, error) {
home.updateRedirect(ctx, progress)
home.updateInstances(ctx, progress)
home.updateRender(ctx, progress)
func (home *Home) Handler(ctx context.Context, route string) (http.Handler, error) {
return home, nil
}