diff options
author | Frédéric Guillot <fred@miniflux.net> | 2018-10-26 19:49:49 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-10-26 19:49:49 -0700 |
commit | f6028f38634c548d13232fc9b86a9428e5ec8c81 (patch) | |
tree | 08fdb649aa60c3ea3a46283c0ca45e58afc5fb05 /storage | |
parent | 92c98bd9860a2839248d5d2c66488190ce4d81d9 (diff) |
Improve Fever middleware and handle groupID=0
Diffstat (limited to 'storage')
-rw-r--r-- | storage/entry.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/storage/entry.go b/storage/entry.go index 0405deb..7617bb6 100644 --- a/storage/entry.go +++ b/storage/entry.go @@ -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 } |