gearheads
/
mastodon
Archived
2
0
Fork 0
This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
mastodon/app/lib/vacuum/access_tokens_vacuum.rb

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