aboutsummaryrefslogtreecommitdiffhomepage
path: root/storage
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-10-26 19:49:49 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-10-26 19:49:49 -0700
commitf6028f38634c548d13232fc9b86a9428e5ec8c81 (patch)
tree08fdb649aa60c3ea3a46283c0ca45e58afc5fb05 /storage
parent92c98bd9860a2839248d5d2c66488190ce4d81d9 (diff)
Improve Fever middleware and handle groupID=0
Diffstat (limited to 'storage')
-rw-r--r--storage/entry.go5
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
}