Browse Source

OAuth token cleanup: Get rid of compile-time configuration

remote-follow-auth-fix
rinpatch 4 years ago
parent
commit
bd3aa8500c
2 changed files with 3 additions and 6 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +2
    -6
      lib/pleroma/web/oauth/token/clean_worker.ex

+ 1
- 0
CHANGELOG.md View File

@@ -82,6 +82,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Report emails now include functional links to profiles of remote user accounts
- Not being able to log in to some third-party apps when logged in to MastoFE
- MRF: `Delete` activities being exempt from MRF policies
- OTP releases: Not being able to configure OAuth expired token cleanup interval
<details>
<summary>API Changes</summary>



+ 2
- 6
lib/pleroma/web/oauth/token/clean_worker.ex View File

@@ -11,11 +11,6 @@ defmodule Pleroma.Web.OAuth.Token.CleanWorker do
@ten_seconds 10_000
@one_day 86_400_000

@interval Pleroma.Config.get(
[:oauth2, :clean_expired_tokens_interval],
@one_day
)

alias Pleroma.Web.OAuth.Token
alias Pleroma.Workers.BackgroundWorker

@@ -29,8 +24,9 @@ defmodule Pleroma.Web.OAuth.Token.CleanWorker do
@doc false
def handle_info(:perform, state) do
BackgroundWorker.enqueue("clean_expired_tokens", %{})
interval = Pleroma.Config.get([:oauth2, :clean_expired_tokens_interval], @one_day)

Process.send_after(self(), :perform, @interval)
Process.send_after(self(), :perform, interval)
{:noreply, state}
end



Loading…
Cancel
Save