Add new cron job for clearing expired source tokens. Closes #121.

This commit is contained in:
Eric Schultz 2018-12-11 14:44:31 -06:00
parent 6d2af56397
commit cfdc6b2d0d

View file

@ -100,4 +100,12 @@ module ScheduledJobs
end
end
def self.delete_expired_source_tokens
return Enumerator.new do |yielder|
yielder << lambda do
tokens_deleted = SourceToken.where("expiration > ?", DateTime.now - 1.day).delete_all
"Deleted #{tokens_deleted} source tokens"
end
end
end
end