Add force update feeds
This commit is contained in:
parent
ddceb28803
commit
4d7843ee5f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue