Move getTimeline to memory.go
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a23b31cefe
commit
42431954e2
|
@ -19,6 +19,7 @@ import (
|
|||
"p83.nl/go/ekster/pkg/fetch"
|
||||
"p83.nl/go/ekster/pkg/microsub"
|
||||
"p83.nl/go/ekster/pkg/server"
|
||||
"p83.nl/go/ekster/pkg/timeline"
|
||||
"p83.nl/go/ekster/pkg/util"
|
||||
|
||||
"github.com/gomodule/redigo/redis"
|
||||
|
@ -725,6 +726,21 @@ func Fetch2(fetchURL string) (*http.Response, error) {
|
|||
return resp, err
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return timeline.Create(channel, timelineType, b.pool)
|
||||
}
|
||||
|
||||
func (b *memoryBackend) createChannel(name string) microsub.Channel {
|
||||
uid := fmt.Sprintf("%012d", b.NextUID)
|
||||
channel := microsub.Channel{
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"p83.nl/go/ekster/pkg/timeline"
|
||||
)
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return timeline.Create(channel, timelineType, b.pool)
|
||||
}
|
Loading…
Reference in New Issue
Block a user