From fff2a92b722e1964ad815c60b233300dc666fc5c Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Thu, 21 Oct 2021 20:03:03 +0200 Subject: [PATCH] breaking change: make "postgres-stream" the default channel type --- cmd/eksterd/http.go | 7 +------ cmd/eksterd/memory.go | 14 ++++---------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/cmd/eksterd/http.go b/cmd/eksterd/http.go index 923c429..d1ac255 100644 --- a/cmd/eksterd/http.go +++ b/cmd/eksterd/http.go @@ -374,13 +374,8 @@ func (h *mainHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } else { page.CurrentSetting = channelSetting{} } - // FIXME: similar code is found in timeline.go if page.CurrentSetting.ChannelType == "" { - if v.UID == "notifications" { - page.CurrentSetting.ChannelType = "stream" - } else { - page.CurrentSetting.ChannelType = "sorted-set" - } + page.CurrentSetting.ChannelType = "postgres-stream" } page.ExcludedTypeNames = map[string]string{ "repost": "Reposts", diff --git a/cmd/eksterd/memory.go b/cmd/eksterd/memory.go index b104300..e7c179c 100644 --- a/cmd/eksterd/memory.go +++ b/cmd/eksterd/memory.go @@ -832,17 +832,11 @@ func Fetch2(fetchURL string) (*http.Response, error) { } func (b *memoryBackend) getTimeline(channel string) timeline.Backend { - timelineType := "sorted-set" - if channel == "notifications" { - timelineType = "stream" - } else { - if setting, ok := b.Settings[channel]; ok { - if setting.ChannelType != "" { - timelineType = setting.ChannelType - } - } + // Set a default timeline type if not set + timelineType := "postgres-stream" + if setting, ok := b.Settings[channel]; ok && setting.ChannelType != "" { + timelineType = setting.ChannelType } - tl := timeline.Create(channel, timelineType, b.pool, b.database) if tl == nil { log.Printf("no timeline found with name %q and type %q", channel, timelineType)