mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-12-05 02:09:03 +01:00
20 lines
485 B
Ruby
20 lines
485 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.expired.in_batches.delete_all
|
|
Doorkeeper::AccessToken.revoked.in_batches.delete_all
|
|
end
|
|
|
|
def vacuum_revoked_access_grants!
|
|
Doorkeeper::AccessGrant.expired.in_batches.delete_all
|
|
Doorkeeper::AccessGrant.revoked.in_batches.delete_all
|
|
end
|
|
end
|