mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-18 06:57:59 +01:00
16 lines
434 B
Elixir
16 lines
434 B
Elixir
defmodule Mix.Tasks.ReindexAll do
|
|
use Mix.Task
|
|
|
|
alias Philomena.SearchIndexer
|
|
|
|
@shortdoc "Destroys and recreates all OpenSearch indices."
|
|
@requirements ["app.start"]
|
|
@impl Mix.Task
|
|
def run(args) do
|
|
if Mix.env() == :prod and not Enum.member?(args, "--i-know-what-im-doing") do
|
|
raise "do not run this task unless you know what you're doing"
|
|
end
|
|
|
|
SearchIndexer.recreate_reindex_all_destructive!()
|
|
end
|
|
end
|