diff options
author | Jacob Wahlgren <jacob@dstsrc.net> | 2019-03-10 18:51:21 +0100 |
---|---|---|
committer | fguillot <fred@miniflux.net> | 2019-03-10 10:51:21 -0700 |
commit | 22b68eefd864a119bac1ba4784d60011c96659af (patch) | |
tree | 5ae66e5fcbbcb436f3680b9187223ecad5caf391 /storage | |
parent | 6764a420b0b135e55bcf885eb4bd2031bf5f7604 (diff) |
Allow users to disable auto-remove
Adds ARCHIVE_READ_DAYS="-1"
Diffstat (limited to 'storage')
-rw-r--r-- | storage/entry.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/storage/entry.go b/storage/entry.go index 811a207..e32ac14 100644 --- a/storage/entry.go +++ b/storage/entry.go @@ -188,6 +188,9 @@ func (s *Storage) UpdateEntries(userID, feedID int64, entries model.Entries, upd // ArchiveEntries changes the status of read items to "removed" after specified days. func (s *Storage) ArchiveEntries(days int) error { + if days < 0 { + return nil + } query := fmt.Sprintf(` UPDATE entries SET status='removed' WHERE id=ANY(SELECT id FROM entries WHERE status='read' AND starred is false AND published_at < now () - '%d days'::interval LIMIT 5000) |