0
0
Fork 0

Keep scheduler jobs unique until they're done (#8287)

This commit is contained in:
Eugen Rochko 2018-08-19 15:48:29 +02:00 committed by GitHub
parent 59c68c1a74
commit 91c929a42c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 0 deletions

View file

@ -3,6 +3,8 @@
class Scheduler::DoorkeeperCleanupScheduler
include Sidekiq::Worker
sidekiq_options unique: :until_executed
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