2017-06-25 22:51:32 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-09-27 02:08:19 +01:00
|
|
|
class Vacuum::AccessTokensVacuum
|
|
|
|
def perform
|
|
|
|
vacuum_revoked_access_tokens!
|
|
|
|
vacuum_revoked_access_grants!
|
|
|
|
end
|
2017-06-25 22:51:32 +01:00
|
|
|
|
2022-09-27 02:08:19 +01:00
|
|
|
private
|
2018-08-19 14:48:29 +01:00
|
|
|
|
2022-09-27 02:08:19 +01:00
|
|
|
def vacuum_revoked_access_tokens!
|
2023-02-08 09:39:57 +00:00
|
|
|
Doorkeeper::AccessToken.where.not(revoked_at: nil).where('revoked_at < NOW()').delete_all
|
2022-09-27 02:08:19 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def vacuum_revoked_access_grants!
|
2023-02-08 09:39:57 +00:00
|
|
|
Doorkeeper::AccessGrant.where.not(revoked_at: nil).where('revoked_at < NOW()').delete_all
|
2017-06-25 22:51:32 +01:00
|
|
|
end
|
|
|
|
end
|