diff options
author | beatrix-bitrot <beatrix.bitrot@gmail.com> | 2017-06-27 20:46:13 +0000 |
---|---|---|
committer | beatrix-bitrot <beatrix.bitrot@gmail.com> | 2017-06-27 20:46:13 +0000 |
commit | ddafde942ca53816c19b0ea0cb40bb1b46cf5668 (patch) | |
tree | c0ac2138fe994c4c2a15c23b47d4155f75148945 /app/workers/scheduler | |
parent | e6300de1421d28d173658e61601b9e016c3d0a6d (diff) | |
parent | da42bfadb58888e3a18afd66395f0f3edc2fa622 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'app/workers/scheduler')
-rw-r--r-- | app/workers/scheduler/doorkeeper_cleanup_scheduler.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/workers/scheduler/doorkeeper_cleanup_scheduler.rb b/app/workers/scheduler/doorkeeper_cleanup_scheduler.rb new file mode 100644 index 000000000..6488798cd --- /dev/null +++ b/app/workers/scheduler/doorkeeper_cleanup_scheduler.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true +require 'sidekiq-scheduler' + +class Scheduler::DoorkeeperCleanupScheduler + include Sidekiq::Worker + + def perform + Doorkeeper::AccessToken.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all + Doorkeeper::AccessGrant.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all + end +end |