Remove FrontendInstallerWorker
This commit is contained in:
parent
08cbd655d1
commit
435bf1f945
4 changed files with 1 additions and 47 deletions
|
|
@ -7,7 +7,6 @@ defmodule Pleroma.Web.AdminAPI.FrontendController do
|
|||
|
||||
alias Pleroma.Config
|
||||
alias Pleroma.Web.Plugs.OAuthScopesPlug
|
||||
alias Pleroma.Workers.FrontendInstallerWorker
|
||||
|
||||
plug(Pleroma.Web.ApiSpec.CastAndValidate)
|
||||
plug(OAuthScopesPlug, %{scopes: ["write"], admin: true} when action == :install)
|
||||
|
|
@ -30,7 +29,7 @@ defmodule Pleroma.Web.AdminAPI.FrontendController do
|
|||
end
|
||||
|
||||
def install(%{body_params: params} = conn, _params) do
|
||||
FrontendInstallerWorker.install(params.name, Map.delete(params, :name))
|
||||
Pleroma.Frontend.install(params.name, Map.delete(params, :name))
|
||||
|
||||
index(conn, %{})
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Workers.FrontendInstallerWorker do
|
||||
use Oban.Worker, queue: :frontend_installer, max_attempts: 1
|
||||
|
||||
alias Oban.Job
|
||||
alias Pleroma.Frontend
|
||||
|
||||
def install(name, opts \\ []) do
|
||||
%{"name" => name, "opts" => Map.new(opts)}
|
||||
|> new()
|
||||
|> Oban.insert()
|
||||
end
|
||||
|
||||
def perform(%Job{args: %{"name" => name, "opts" => opts}}) do
|
||||
opts = Keyword.new(opts, fn {key, value} -> {String.to_existing_atom(key), value} end)
|
||||
Frontend.install(name, opts)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue