From: sn0w Date: Thu, 8 Dec 2022 09:04:20 +0000 (+0100) Subject: Skip posts in indexer where publish date is nil X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=4c0911592b7f76e75d6741511a07bc39573d6d6a;p=akkoma Skip posts in indexer where publish date is nil --- diff --git a/lib/pleroma/search/elasticsearch/document_mappings/activity.ex b/lib/pleroma/search/elasticsearch/document_mappings/activity.ex index 3a84e991b..b77c6e0d2 100644 --- a/lib/pleroma/search/elasticsearch/document_mappings/activity.ex +++ b/lib/pleroma/search/elasticsearch/document_mappings/activity.ex @@ -30,7 +30,7 @@ defimpl Elasticsearch.Document, for: Pleroma.Activity do trimmed end - if String.length(content) > 1 do + if String.length(content) > 1 and not is_nil(data["published"]) do {:ok, published, _} = DateTime.from_iso8601(data["published"]) %{ diff --git a/lib/pleroma/search/meilisearch.ex b/lib/pleroma/search/meilisearch.ex index 770557858..c36b8f751 100644 --- a/lib/pleroma/search/meilisearch.ex +++ b/lib/pleroma/search/meilisearch.ex @@ -128,7 +128,7 @@ defmodule Pleroma.Search.Meilisearch do trimmed end - if String.length(content) > 1 do + if String.length(content) > 1 and not is_nil(data["published"]) do {:ok, published, _} = DateTime.from_iso8601(data["published"]) %{