2017-06-25 21:51:32 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-09-27 01:08:19 +00:00
|
|
|
class Vacuum::AccessTokensVacuum
|
|
|
|
def perform
|
|
|
|
vacuum_revoked_access_tokens!
|
|
|
|
vacuum_revoked_access_grants!
|
|
|
|
end
|
2017-06-25 21:51:32 +00:00
|
|
|
|
2022-09-27 01:08:19 +00:00
|
|
|
private
|
2018-08-19 13:48:29 +00:00
|
|
|
|
2022-09-27 01:08:19 +00:00
|
|
|
def vacuum_revoked_access_tokens!
|
2024-06-11 08:50:51 +00:00
|
|
|
Doorkeeper::AccessToken.expired.in_batches.delete_all
|
|
|
|
Doorkeeper::AccessToken.revoked.in_batches.delete_all
|
2022-09-27 01:08:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def vacuum_revoked_access_grants!
|
2024-06-11 08:50:51 +00:00
|
|
|
Doorkeeper::AccessGrant.expired.in_batches.delete_all
|
|
|
|
Doorkeeper::AccessGrant.revoked.in_batches.delete_all
|
2017-06-25 21:51:32 +00:00
|
|
|
end
|
|
|
|
end
|