From 6d23d40420e4548778f3ca4ed9e8cb16e0eb0073 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 1 Jul 2020 19:05:21 +0200 Subject: Change Redis#exists calls to Redis#exists? to avoid deprecation warning (#14191) --- app/models/account_conversation.rb | 2 +- app/models/encrypted_message.rb | 5 +---- app/models/home_feed.rb | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'app/models') diff --git a/app/models/account_conversation.rb b/app/models/account_conversation.rb index 0c03747e2..b43816588 100644 --- a/app/models/account_conversation.rb +++ b/app/models/account_conversation.rb @@ -108,7 +108,7 @@ class AccountConversation < ApplicationRecord end def subscribed_to_timeline? - Redis.current.exists("subscribed:#{streaming_channel}") + Redis.current.exists?("subscribed:#{streaming_channel}") end def streaming_channel diff --git a/app/models/encrypted_message.rb b/app/models/encrypted_message.rb index 5e0aba434..aa4182b4e 100644 --- a/app/models/encrypted_message.rb +++ b/app/models/encrypted_message.rb @@ -32,16 +32,13 @@ class EncryptedMessage < ApplicationRecord private def push_to_streaming_api - Rails.logger.info(streaming_channel) - Rails.logger.info(subscribed_to_timeline?) - return if destroyed? || !subscribed_to_timeline? PushEncryptedMessageWorker.perform_async(id) end def subscribed_to_timeline? - Redis.current.exists("subscribed:#{streaming_channel}") + Redis.current.exists?("subscribed:#{streaming_channel}") end def streaming_channel diff --git a/app/models/home_feed.rb b/app/models/home_feed.rb index 1fd506138..0fe9dae46 100644 --- a/app/models/home_feed.rb +++ b/app/models/home_feed.rb @@ -8,6 +8,6 @@ class HomeFeed < Feed end def regenerating? - redis.exists("account:#{@id}:regeneration") + redis.exists?("account:#{@id}:regeneration") end end -- cgit