This commit is contained in:
Nazar Kanaev 2022-02-15 21:56:32 +00:00
parent fbd0b2310e
commit 954b549029

View File

@ -293,17 +293,17 @@ func (s *Storage) SyncSearch() {
} }
var ( var (
itemsKeepSize = 100 itemsKeepSize = 50
itemsKeepDays = 90 itemsKeepDays = 90
) )
// Delete old articles from the database to cleanup space. // Delete old articles from the database to cleanup space.
// //
// The rules: // The rules:
// * Never delete starred entries // * Never delete starred entries.
// * Take each feed capacity (number of entries provided by the feed) // * Keep at least the same amount of articles the feed provides (default: 50).
// into account (see `SetFeedSize`, default: 100). // This prevents from deleting items for rarely updated and/or ever-growing
// This prevents old items from reappearing after the cleanup. // feeds which might eventually reappear as unread.
// * Keep entries for a certain period (default: 90 days). // * Keep entries for a certain period (default: 90 days).
func (s *Storage) DeleteOldItems() { func (s *Storage) DeleteOldItems() {
rows, err := s.db.Query(` rows, err := s.db.Query(`