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.
19 lines
451 B
19 lines
451 B
8 years ago
|
# frozen_string_literal: true
|
||
|
|
||
2 years ago
|
class Vacuum::AccessTokensVacuum
|
||
|
def perform
|
||
|
vacuum_revoked_access_tokens!
|
||
|
vacuum_revoked_access_grants!
|
||
|
end
|
||
8 years ago
|
|
||
2 years ago
|
private
|
||
6 years ago
|
|
||
2 years ago
|
def vacuum_revoked_access_tokens!
|
||
8 years ago
|
Doorkeeper::AccessToken.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all
|
||
2 years ago
|
end
|
||
|
|
||
|
def vacuum_revoked_access_grants!
|
||
8 years ago
|
Doorkeeper::AccessGrant.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all
|
||
|
end
|
||
|
end
|