drop calendar module
1 file changed, 0 insertions(+), 26 deletions(-)
changed files
M domain/web/website.go → domain/web/website.go
@@ -1,11 +1,9 @@ package website import ( - "context" "net/http" "os" "sync" - "time" "alin.ovh/x/log" "github.com/Southclaws/fault"@@ -15,7 +13,6 @@ "alin.ovh/homestead/domain/analytics" "alin.ovh/homestead/domain/analytics/goatcounter" "alin.ovh/homestead/domain/analytics/nullcounter" - "alin.ovh/homestead/domain/calendar" "alin.ovh/homestead/domain/content/fetcher" "alin.ovh/homestead/domain/content/publisher" "alin.ovh/homestead/domain/identity"@@ -36,7 +33,6 @@ Redirect bool `conf:"default:true"` Development bool `conf:"default:false,flag:dev"` FetchURL config.URL `conf:"default:https://ci.alin.ovh/archive/website/"` BaseURL config.URL - CalendarURL config.URL Timezone config.Timezone `conf:"default:Europe/Berlin"` Goatcounter goatcounter.Options@@ -53,7 +49,6 @@ siteSettings *templates.SiteSettings counter analytics.Counter log *log.Logger reader storage.Reader - calendar *calendar.Calendar identity *identity.Service publisher *publisher.Service *server.App@@ -94,12 +89,6 @@ if err != nil { return nil, fault.Wrap(err, fmsg.With("could not create update listener")) } - website.calendar = calendar.New(&calendar.Options{ - URL: opts.CalendarURL, - Timezone: opts.Timezone, - Cache: !opts.Development, - }, log.Named("calendar")) - website.identity = identity.New(opts.OIDC, log.Named("identity")) website.publisher, err = publisher.New(&publisher.Options{ Development: opts.Development,@@ -140,11 +129,6 @@ go func() { updated := sync.OnceFunc(func() { firstUpdate <- true close(firstUpdate) - - website.FetchCalendar() - for range time.Tick(15 * time.Minute) { - website.FetchCalendar() - } }) for root := range roots { log.Debug("getting config from source", "source", root)@@ -182,7 +166,6 @@ mux := ihttp.NewServeMux(log.Named("http")) mux.HandleError(website.ErrorHandler) mux.Handle("/", website) - mux.HandleFunc("/calendar", website.Calendar) website.identity.RegisterHandlers(mux) if website.publisher != nil { website.publisher.RegisterHandlers(mux)@@ -196,7 +179,6 @@ return nil } mux.HandleFunc("/style.css", staticHandler) - mux.HandleFunc("/calendar.css", staticHandler) } website.Handler = analytics.CounterMiddleware(website.counter, mux)@@ -214,11 +196,3 @@ } return nil } - -func (w *Website) FetchCalendar() { - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - if err := w.calendar.FetchIfNeeded(ctx); err != nil { - w.log.Error("could not fetch calendar", "error", err) - } - cancel() -}