You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
glitchier-soc/app/lib/vacuum/access_tokens_vacuum.rb

19 lines
441 B

# 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