remove broken task
Some checks failed
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
ci/woodpecker/push/test Pipeline failed

This commit is contained in:
sadposter 2022-06-30 19:43:30 +01:00
parent 0122512c2a
commit 6c01646ebf
3 changed files with 6 additions and 47 deletions

View file

@ -58,7 +58,7 @@ def start_pleroma do
[name: Pleroma.MajicPool, pool_size: Pleroma.Config.get([:majic_pool, :size], 2)]} [name: Pleroma.MajicPool, pool_size: Pleroma.Config.get([:majic_pool, :size], 2)]}
] ++ ] ++
http_children(adapter) ++ http_children(adapter) ++
elasticsearch_children() elasticsearch_children()
cachex_children = Enum.map(@cachex_children, &Pleroma.Application.build_cachex(&1, [])) cachex_children = Enum.map(@cachex_children, &Pleroma.Application.build_cachex(&1, []))

View file

@ -5,48 +5,16 @@
defmodule Mix.Tasks.Pleroma.Search do defmodule Mix.Tasks.Pleroma.Search do
use Mix.Task use Mix.Task
import Mix.Pleroma import Mix.Pleroma
import Ecto.Query
alias Pleroma.Activity
alias Pleroma.Pagination
alias Pleroma.User
alias Pleroma.Hashtag
@shortdoc "Manages elasticsearch" @shortdoc "Manages elasticsearch"
def run(["import", "activities" | _rest]) do def run(["import", "activities" | _rest]) do
start_pleroma() start_pleroma()
Elasticsearch.Index.Bulk.upload(Pleroma.Search.Elasticsearch.Cluster, Elasticsearch.Index.Bulk.upload(
"activities", Pleroma.Search.Elasticsearch.Cluster,
Pleroma.Config.get([Pleroma.Search.Elasticsearch.Cluster, :indexes, :activities])) "activities",
#from(a in Activity, where: not ilike(a.actor, "%/relay")) Pleroma.Config.get([Pleroma.Search.Elasticsearch.Cluster, :indexes, :activities])
#|> where([a], fragment("(? ->> 'type'::text) = 'Create'", a.data)) )
#|> Activity.with_preloaded_object()
#|> Activity.with_preloaded_user_actor()
#|> get_all(:activities)
end
defp get_all(query, index, max_id \\ nil) do
params = %{limit: 1000}
params =
if max_id == nil do
params
else
Map.put(params, :max_id, max_id)
end
res =
query
|> Pagination.fetch_paginated(params)
if res == [] do
:ok
else
res
|> Enum.map(fn x -> Pleroma.Search.Elasticsearch.add_to_index(x) end)
get_all(query, index, List.last(res).id)
end
end end
end end

View file

@ -1,9 +0,0 @@
defmodule Mix.Tasks.Pleroma.Search.Elasticsearch do
alias Mix.Tasks.Elasticsearch.Build
import Mix.Pleroma
def run(["index" | args]) do
start_pleroma()
Build.run(args)
end
end