Add force update feeds

This commit is contained in:
Shadowfacts 2021-09-08 20:17:33 -04:00
parent ddceb28803
commit 4d7843ee5f
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 14 additions and 2 deletions

View File

@ -53,6 +53,20 @@ defmodule Frenzy.UpdateFeeds do
Logger.info("Updating #{count} feeds")
do_update_feeds(feeds)
prune_old_items()
end
def force_update_feeds() do
feeds = Repo.all(Feed)
Logger.info("Force updating #{Enum.count(feeds)} feeds")
do_update_feeds(feeds)
end
defp do_update_feeds(feeds) do
Enum.each(feeds, fn feed ->
try do
update_feed(feed)
@ -63,8 +77,6 @@ defmodule Frenzy.UpdateFeeds do
)
end
end)
prune_old_items()
end
defp prune_old_items() do