Move the search.ex file so credo doesn't complain
authorEkaterina Vaartis <vaartis@kotobank.ch>
Sun, 14 Nov 2021 17:24:05 +0000 (20:24 +0300)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Wed, 29 Jun 2022 19:48:59 +0000 (20:48 +0100)
lib/pleroma/search.ex
lib/pleroma/search/search.ex [deleted file]

index 99bce632c266e6571da688873e43d8ddf1412aaa..e363abf1946763f7e3b2e88ac52575259f3c9bd0 100644 (file)
@@ -1,12 +1,18 @@
 defmodule Pleroma.Search do
-  @type search_map :: %{
-          statuses: [map],
-          accounts: [map],
-          hashtags: [map]
-        }
+  def add_to_index(activity) do
+    search_module = Pleroma.Config.get([Pleroma.Search, :module])
 
-  @doc """
-  Searches for stuff
-  """
-  @callback search(map, map, keyword) :: search_map
+    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
diff --git a/lib/pleroma/search/search.ex b/lib/pleroma/search/search.ex
deleted file mode 100644 (file)
index e363abf..0000000
+++ /dev/null
@@ -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