From: FloatingGhost Date: Tue, 14 Dec 2021 14:33:34 +0000 (+0000) Subject: add timeouts X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=bed6f4e12cc7ff259db3e515243e1275733c389b;p=akkoma add timeouts --- diff --git a/lib/pleroma/search/elasticsearch.ex b/lib/pleroma/search/elasticsearch.ex index e770fe536..00ae6b3dc 100644 --- a/lib/pleroma/search/elasticsearch.ex +++ b/lib/pleroma/search/elasticsearch.ex @@ -9,6 +9,12 @@ defmodule Pleroma.Search.Elasticsearch do defp es_query(:activity, query) do %{ + size: 50, + terminate_after: 50, + timeout: "5s", + sort: [ + %{"_timestamp" => "desc"} + ], query: %{ bool: %{ must: Parsers.Activity.parse(query) @@ -19,6 +25,9 @@ defmodule Pleroma.Search.Elasticsearch do defp es_query(:user, query) do %{ + size: 50, + terminate_after: 50, + timeout: "5s", query: %{ bool: %{ must: Parsers.User.parse(query) @@ -29,6 +38,9 @@ defmodule Pleroma.Search.Elasticsearch do defp es_query(:hashtag, query) do %{ + size: 50, + terminate_after: 50, + timeout: "5s", query: %{ bool: %{ must: Parsers.Hashtag.parse(query)