Move the search.ex file so credo doesn't complain

This commit is contained in:
Ekaterina Vaartis 2021-11-14 20:24:05 +03:00 committed by FloatingGhost
parent 7a9d9cf457
commit 5dd908552c
2 changed files with 15 additions and 27 deletions

View file

@ -1,12 +1,18 @@
defmodule Pleroma.Search do defmodule Pleroma.Search do
@type search_map :: %{ def add_to_index(activity) do
statuses: [map], search_module = Pleroma.Config.get([Pleroma.Search, :module])
accounts: [map],
hashtags: [map]
}
@doc """ ConcurrentLimiter.limit(Pleroma.Search, fn ->
Searches for stuff Task.start(fn -> search_module.add_to_index(activity) end)
""" end)
@callback search(map, map, keyword) :: search_map end
def remove_from_index(object) do
# Also delete from search index
search_module = Pleroma.Config.get([Pleroma.Search, :module])
ConcurrentLimiter.limit(Pleroma.Search, fn ->
Task.start(fn -> search_module.remove_from_index(object) end)
end)
end
end end

View file

@ -1,18 +0,0 @@
defmodule Pleroma.Search do
def add_to_index(activity) do
search_module = Pleroma.Config.get([Pleroma.Search, :module])
ConcurrentLimiter.limit(Pleroma.Search, fn ->
Task.start(fn -> search_module.add_to_index(activity) end)
end)
end
def remove_from_index(object) do
# Also delete from search index
search_module = Pleroma.Config.get([Pleroma.Search, :module])
ConcurrentLimiter.limit(Pleroma.Search, fn ->
Task.start(fn -> search_module.remove_from_index(object) end)
end)
end
end