Fix crash on missing feed update date
This commit is contained in:
parent
68280cea8e
commit
b686938bfa
|
@ -80,11 +80,18 @@ defmodule Frenzy.UpdateFeeds do
|
|||
end
|
||||
|
||||
defp update_feed_from_rss(feed, rss) do
|
||||
last_updated =
|
||||
if rss.updated_at do
|
||||
parse_date(rss.updated_at)
|
||||
else
|
||||
DateTime.utc_now()
|
||||
end
|
||||
|
||||
changeset =
|
||||
Feed.changeset(feed, %{
|
||||
title: rss.title,
|
||||
site_url: rss.link.href,
|
||||
last_updated: parse_date(rss.updated_at)
|
||||
last_updated: last_updated
|
||||
})
|
||||
|
||||
Repo.update(changeset)
|
||||
|
|
Loading…
Reference in New Issue