Fix crash caused filter tombstone-ing an item

This commit is contained in:
Shadowfacts 2019-10-31 14:26:02 -04:00
parent 6a30b57ca4
commit 9e6b185cfd
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
defmodule Frenzy.UpdateFeeds do defmodule Frenzy.UpdateFeeds do
use GenServer use GenServer
alias Frenzy.{Repo, Feed, Item, FilterEngine} alias Frenzy.{Repo, Feed, Item}
import Ecto.Query import Ecto.Query
require Logger require Logger
@ -70,10 +70,10 @@ defmodule Frenzy.UpdateFeeds do
status_code: 200, status_code: 200,
body: body, body: body,
headers: headers headers: headers
}} = response -> }} ->
{_, content_type} = {_, content_type} =
headers headers
|> Enum.find(fn {k, v} -> k == "Content-Type" end) |> Enum.find(fn {k, _v} -> k == "Content-Type" end)
content_type = content_type =
content_type content_type
@ -183,7 +183,7 @@ defmodule Frenzy.UpdateFeeds do
:tombstone -> :tombstone ->
changeset = changeset =
Ecto.build_assoc(feed, :items, %{ Ecto.build_assoc(feed, :items, %{
guid: entry.id, guid: item_params.guid,
tombstone: true tombstone: true
}) })