diff --git a/lib/frenzy/update_feeds.ex b/lib/frenzy/update_feeds.ex index 7c0e8ff..dbd738e 100644 --- a/lib/frenzy/update_feeds.ex +++ b/lib/frenzy/update_feeds.ex @@ -49,9 +49,11 @@ defmodule Frenzy.UpdateFeeds do defp prune_old_items() do {count, _} = from(i in Item, - where: i.read and not i.tombstone, - # where: i.read_date <= from_now(-1, "week"), - where: i.read_date <= from_now(-1, "minute"), + where: not i.tombstone, + # todo: these time intervals should be configurable by the admin + where: + (i.read and i.read_date <= from_now(-1, "week")) or + (not i.read and i.inserted_at <= from_now(-2, "week")), update: [ set: [tombstone: true, content: nil, creator: nil, date: nil, url: nil, title: nil] ]