1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Improve Fever middleware and handle groupID=0

This commit is contained in:
Frédéric Guillot 2018-10-26 19:49:49 -07:00
parent 92c98bd986
commit f6028f3863
3 changed files with 22 additions and 4 deletions

View file

@ -261,11 +261,14 @@ func (s *Storage) MarkAllAsRead(userID int64) error {
defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:MarkAllAsRead] userID=%d", userID))
query := `UPDATE entries SET status=$1 WHERE user_id=$2 AND status=$3`
_, err := s.db.Exec(query, model.EntryStatusRead, userID, model.EntryStatusUnread)
result, err := s.db.Exec(query, model.EntryStatusRead, userID, model.EntryStatusUnread)
if err != nil {
return fmt.Errorf("unable to mark all entries as read: %v", err)
}
count, _ := result.RowsAffected()
logger.Debug("[Storage:MarkAllAsRead] %d items marked as read", count)
return nil
}