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 {
|
||||
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",
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user