mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-14 02:44:13 +00:00
19 lines
451 B
Ruby
19 lines
451 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('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
|