Prune unread items after two weeks
This commit is contained in:
parent
1603d907c8
commit
2d88b0b4e1
@ -49,9 +49,11 @@ defmodule Frenzy.UpdateFeeds do
|
|||||||
defp prune_old_items() do
|
defp prune_old_items() do
|
||||||
{count, _} =
|
{count, _} =
|
||||||
from(i in Item,
|
from(i in Item,
|
||||||
where: i.read and not i.tombstone,
|
where: not i.tombstone,
|
||||||
# where: i.read_date <= from_now(-1, "week"),
|
# todo: these time intervals should be configurable by the admin
|
||||||
where: i.read_date <= from_now(-1, "minute"),
|
where:
|
||||||
|
(i.read and i.read_date <= from_now(-1, "week")) or
|
||||||
|
(not i.read and i.inserted_at <= from_now(-2, "week")),
|
||||||
update: [
|
update: [
|
||||||
set: [tombstone: true, content: nil, creator: nil, date: nil, url: nil, title: nil]
|
set: [tombstone: true, content: nil, creator: nil, date: nil, url: nil, title: nil]
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user