Add logging for timeline fetching
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
dcff9a4890
commit
9d81cc9a3a
|
@ -731,8 +731,8 @@ func (b *memoryBackend) updateChannelUnreadCount(channel string) error {
|
||||||
b.lock.RUnlock()
|
b.lock.RUnlock()
|
||||||
|
|
||||||
if exists {
|
if exists {
|
||||||
timeline := b.getTimeline(channel)
|
tl := b.getTimeline(channel)
|
||||||
unread, err := timeline.Count()
|
unread, err := tl.Count()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -834,7 +834,11 @@ func (b *memoryBackend) getTimeline(channel string) timeline.Backend {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return timeline.Create(channel, timelineType, b.pool, b.database)
|
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)
|
||||||
|
}
|
||||||
|
return tl
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *memoryBackend) createChannel(name string) microsub.Channel {
|
func (b *memoryBackend) createChannel(name string) microsub.Channel {
|
||||||
|
|
|
@ -31,6 +31,7 @@ type Backend interface {
|
||||||
// Create creates a channel of the specified type. Return nil when the type
|
// Create creates a channel of the specified type. Return nil when the type
|
||||||
// is not known.
|
// is not known.
|
||||||
func Create(channel, timelineType string, pool *redis.Pool, db *sql.DB) Backend {
|
func Create(channel, timelineType string, pool *redis.Pool, db *sql.DB) Backend {
|
||||||
|
log.Printf("fetching timeline with type %s", timelineType)
|
||||||
if timelineType == "sorted-set" {
|
if timelineType == "sorted-set" {
|
||||||
timeline := &redisSortedSetTimeline{channel: channel, pool: pool}
|
timeline := &redisSortedSetTimeline{channel: channel, pool: pool}
|
||||||
err := timeline.Init()
|
err := timeline.Init()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user