mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-24 23:18:06 +01:00
0592937264
* Apply Rubocop Rails/WhereNot * Update spec for where.not
18 lines
441 B
Ruby
18 lines
441 B
Ruby
# 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.not(revoked_at: nil).where('revoked_at < NOW()').delete_all
|
|
end
|
|
|
|
def vacuum_revoked_access_grants!
|
|
Doorkeeper::AccessGrant.where.not(revoked_at: nil).where('revoked_at < NOW()').delete_all
|
|
end
|
|
end
|