2017-06-26 06:51:32 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-09-27 10:08:19 +09:00
|
|
|
class Vacuum::AccessTokensVacuum
|
|
|
|
def perform
|
|
|
|
vacuum_revoked_access_tokens!
|
|
|
|
vacuum_revoked_access_grants!
|
|
|
|
end
|
2017-06-26 06:51:32 +09:00
|
|
|
|
2022-09-27 10:08:19 +09:00
|
|
|
private
|
2018-08-19 22:48:29 +09:00
|
|
|
|
2022-09-27 10:08:19 +09:00
|
|
|
def vacuum_revoked_access_tokens!
|
2017-06-26 06:51:32 +09:00
|
|
|
Doorkeeper::AccessToken.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all
|
2022-09-27 10:08:19 +09:00
|
|
|
end
|
|
|
|
|
|
|
|
def vacuum_revoked_access_grants!
|
2017-06-26 06:51:32 +09:00
|
|
|
Doorkeeper::AccessGrant.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all
|
|
|
|
end
|
|
|
|
end
|