Add Cron worker to clean up orphaned apps hourly
This commit is contained in:
parent
7bd0750787
commit
a1951f3af7
4 changed files with 41 additions and 1 deletions
|
|
@ -53,4 +53,16 @@ defmodule Pleroma.Web.OAuth.AppTest do
|
|||
|
||||
assert Enum.sort(App.get_user_apps(user)) == Enum.sort(apps)
|
||||
end
|
||||
|
||||
test "removes orphaned apps" do
|
||||
attrs = %{client_name: "Mastodon-Local", redirect_uris: "."}
|
||||
{:ok, %App{} = app} = App.get_or_make(attrs, ["write"])
|
||||
assert app.scopes == ["write"]
|
||||
|
||||
assert app == Pleroma.Repo.get_by(App, %{id: app.id})
|
||||
|
||||
App.remove_orphans()
|
||||
|
||||
assert nil == Pleroma.Repo.get_by(App, %{id: app.id})
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue