diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-11-18 04:38:27 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-11-18 04:38:27 -0600 |
commit | 2c32b36a57c7e00c34b06d3c223b291e06c651cc (patch) | |
tree | 04df6a26bf45854438144ba0d2d672140a83a993 /db/migrate | |
parent | 0d372272662331e0783580d1a91ed9125ad4b4f1 (diff) |
Remove filter caches.
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20191118102858_clear_filter_cache.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20191118102858_clear_filter_cache.rb b/db/migrate/20191118102858_clear_filter_cache.rb new file mode 100644 index 000000000..1c19f68d2 --- /dev/null +++ b/db/migrate/20191118102858_clear_filter_cache.rb @@ -0,0 +1,12 @@ +class ClearFilterCache < ActiveRecord::Migration[5.2] + include Redisable + + def change + ['custom_cw', 'filtered_threads', 'filtered_statuses'].each do |ns| + Rails.logger.info("Clearing keys matching '#{ns}:*' ...") + Rails.cache.delete_matched("#{ns}:*") + keys = redis.keys("#{ns}:*") + redis.del(*keys) unless keys.empty? + end + end +end |