Add retention policy for cached content and media (#19232)
This commit is contained in:
parent
3e0999cd11
commit
5c9abdeff1
30 changed files with 559 additions and 135 deletions
18
app/lib/vacuum/access_tokens_vacuum.rb
Normal file
18
app/lib/vacuum/access_tokens_vacuum.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Vacuum::AccessTokensVacuum
|
||||
def perform
|
||||
vacuum_revoked_access_tokens!
|
||||
vacuum_revoked_access_grants!
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def vacuum_revoked_access_tokens!
|
||||
Doorkeeper::AccessToken.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all
|
||||
end
|
||||
|
||||
def vacuum_revoked_access_grants!
|
||||
Doorkeeper::AccessGrant.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue