breaking change: make "postgres-stream" the default channel type
This commit is contained in:
parent
b5ec260665
commit
fff2a92b72
|
@ -374,13 +374,8 @@ func (h *mainHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
} else {
|
} else {
|
||||||
page.CurrentSetting = channelSetting{}
|
page.CurrentSetting = channelSetting{}
|
||||||
}
|
}
|
||||||
// FIXME: similar code is found in timeline.go
|
|
||||||
if page.CurrentSetting.ChannelType == "" {
|
if page.CurrentSetting.ChannelType == "" {
|
||||||
if v.UID == "notifications" {
|
page.CurrentSetting.ChannelType = "postgres-stream"
|
||||||
page.CurrentSetting.ChannelType = "stream"
|
|
||||||
} else {
|
|
||||||
page.CurrentSetting.ChannelType = "sorted-set"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
page.ExcludedTypeNames = map[string]string{
|
page.ExcludedTypeNames = map[string]string{
|
||||||
"repost": "Reposts",
|
"repost": "Reposts",
|
||||||
|
|
|
@ -832,17 +832,11 @@ func Fetch2(fetchURL string) (*http.Response, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *memoryBackend) getTimeline(channel string) timeline.Backend {
|
func (b *memoryBackend) getTimeline(channel string) timeline.Backend {
|
||||||
timelineType := "sorted-set"
|
// Set a default timeline type if not set
|
||||||
if channel == "notifications" {
|
timelineType := "postgres-stream"
|
||||||
timelineType = "stream"
|
if setting, ok := b.Settings[channel]; ok && setting.ChannelType != "" {
|
||||||
} else {
|
timelineType = setting.ChannelType
|
||||||
if setting, ok := b.Settings[channel]; ok {
|
|
||||||
if setting.ChannelType != "" {
|
|
||||||
timelineType = setting.ChannelType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tl := timeline.Create(channel, timelineType, b.pool, b.database)
|
tl := timeline.Create(channel, timelineType, b.pool, b.database)
|
||||||
if tl == nil {
|
if tl == nil {
|
||||||
log.Printf("no timeline found with name %q and type %q", channel, timelineType)
|
log.Printf("no timeline found with name %q and type %q", channel, timelineType)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user