discourse/spec/jobs/clean_up_digest_keys.rb
Robin Ward 3ce2077aa8 Migrate unsubscribe keys to the database.
This should reduce a lot of the keys in redis.
2015-02-13 14:24:15 -05:00

13 lines
226 B
Ruby

module Jobs
class CleanUpDigestKeys < Jobs::Scheduled
every 1.day
def execute(args)
# Remove unused digest keys
DigestUnsubscribeKey.where('created_at < ?', 2.months.ago).delete_all
end
end
end