Compare commits

..

No commits in common. "46c308619e718b83e2b128ff12050075cce0de5b" and "a684c0c6afbee6a89f4ba4a92b840f6a463adcf0" have entirely different histories.

2 changed files with 3 additions and 7 deletions

View File

@ -191,7 +191,7 @@ func (h *hubIncomingBackend) Feeds() ([]Feed, error) {
parts := strings.Split(feedKey, ":")
if len(parts) == 2 {
feed.ID, _ = strconv.ParseInt(parts[1], 10, 64)
_, err = conn.Do("HSET", feedKey, "id", feed.ID)
_, err = conn.Do("HPUT", feedKey, "id", feed.ID)
if err != nil {
log.Printf("could not save id for %s: %v", feedKey, err)
}
@ -208,7 +208,7 @@ func (h *hubIncomingBackend) Feeds() ([]Feed, error) {
}
feed.Callback = fmt.Sprintf("%s/incoming/%d", h.baseURL, feed.ID)
_, err = conn.Do("HSET", feedKey, "callback", feed.Callback)
_, err = conn.Do("HPUT", feedKey, "callback", feed.Callback)
if err != nil {
log.Printf("could not save id for %s: %v", feedKey, err)
}

View File

@ -661,14 +661,10 @@ func (b *memoryBackend) updateChannelUnreadCount(channel string) error {
return err
}
defer b.save()
currentCount := c.Unread.UnreadCount
c.Unread = microsub.Unread{Type: microsub.UnreadCount, UnreadCount: unread}
// Sent message to Server-Sent-Events
if currentCount != unread {
b.broker.Notifier <- sse.Message{Event: "new item in channel", Object: c}
}
b.broker.Notifier <- sse.Message{Event: "new item in channel", Object: c}
b.lock.Lock()
b.Channels[channel] = c