breaking change: make "postgres-stream" the default channel type

This commit is contained in:
Peter Stuifzand 2021-10-21 20:03:03 +02:00
parent b5ec260665
commit fff2a92b72
Signed by: peter
GPG Key ID: 374322D56E5209E8
2 changed files with 5 additions and 16 deletions

View File

@ -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",

View File

@ -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)