diff options
author | Hakaba Hitoyo <example@example.com> | 2018-09-09 13:57:23 +0900 |
---|---|---|
committer | Hakaba Hitoyo <example@example.com> | 2018-09-09 13:57:23 +0900 |
commit | 4e1bb7bccb196f26c55f6d3764e0066f81e92bd4 (patch) | |
tree | d351c3ac31e044e6f039660d7b3cf8b409f408c0 /lib/pleroma/web/mastodon_api | |
parent | 045953225e04862c914b51808907cc86b11fcaf4 (diff) | |
download | pleroma-4e1bb7bccb196f26c55f6d3764e0066f81e92bd4.tar.gz |
make limit for /api/v1/suggestions
Diffstat (limited to 'lib/pleroma/web/mastodon_api')
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index f2fcc76ad..e5d4245c4 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -1148,6 +1148,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do if Keyword.get(@suggestions, :enabled, false) do api = Keyword.get(@suggestions, :third_party_engine, "") timeout = Keyword.get(@suggestions, :timeout, 5000) + limit = Keyword.get(@suggestions, :limit, 23) host = Application.get_env(:pleroma, Pleroma.Web.Endpoint) @@ -1161,7 +1162,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do @httpoison.get(url, [], timeout: timeout, recv_timeout: timeout), {:ok, data} <- Jason.decode(body) do data2 = - Enum.slice(data, 0, 40) + Enum.slice(data, 0, limit) |> Enum.map(fn x -> Map.put( x, |