aboutsummaryrefslogtreecommitdiffhomepage
path: root/storage
diff options
context:
space:
mode:
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
}