about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-04-27 20:14:47 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:22 -0500
commit13262ea61433cce3b8d96fe53d5d9255ef5fba7f (patch)
treec25c217cb3157315cc145d7deac757fbf83fe890 /app/lib
parent26d90a36ff07aa905db63985886d5c08c934b7b6 (diff)
Remove cached status when sharekey changed.
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/bangtags.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index 6f2f03d30..c1bb62c3d 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -251,6 +251,7 @@ class Bangtags
                   if roar.sharekey.present?
                     roar.sharekey = nil
                     roar.save
+                    Rails.cache.delete("statuses/#{roar.id}")
                   end
                 end
               end
@@ -262,6 +263,7 @@ class Bangtags
                   sharekey = SecureRandom.urlsafe_base64(32)
                   earliest_roar.sharekey = sharekey
                   earliest_roar.save
+                  Rails.cache.delete("statuses/#{earliest_roar.id}")
                 else
                   sharekey = earliest_roar.sharekey
                 end
@@ -269,11 +271,13 @@ class Bangtags
                   if roar.sharekey != sharekey
                     roar.sharekey = sharekey
                     roar.save
+                    Rails.cache.delete("statuses/#{roar.id}")
                   end
                 end
               else
                 status.sharekey = SecureRandom.urlsafe_base64(32)
                 status.save
+                Rails.cache.delete("statuses/#{status.id}")
               end
             end
           end