Change Redis#exists calls to Redis#exists? to avoid deprecation warning (#14191)
This commit is contained in:
parent
e9ea960773
commit
6d23d40420
14 changed files with 38 additions and 33 deletions
|
@ -132,7 +132,7 @@ class ActivityPub::Activity
|
|||
end
|
||||
|
||||
def delete_arrived_first?(uri)
|
||||
redis.exists("delete_upon_arrival:#{@account.id}:#{uri}")
|
||||
redis.exists?("delete_upon_arrival:#{@account.id}:#{uri}")
|
||||
end
|
||||
|
||||
def delete_later!(uri)
|
||||
|
|
|
@ -33,7 +33,7 @@ class ActivityPub::Activity::Move < ActivityPub::Activity
|
|||
end
|
||||
|
||||
def processed?
|
||||
redis.exists("move_in_progress:#{@account.id}")
|
||||
redis.exists?("move_in_progress:#{@account.id}")
|
||||
end
|
||||
|
||||
def mark_as_processing!
|
||||
|
|
|
@ -169,7 +169,7 @@ class FeedManager
|
|||
private
|
||||
|
||||
def push_update_required?(timeline_id)
|
||||
redis.exists("subscribed:#{timeline_id}")
|
||||
redis.exists?("subscribed:#{timeline_id}")
|
||||
end
|
||||
|
||||
def blocks_or_mutes?(receiver_id, account_ids, context)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -8,6 +8,6 @@ class HomeFeed < Feed
|
|||
end
|
||||
|
||||
def regenerating?
|
||||
redis.exists("account:#{@id}:regeneration")
|
||||
redis.exists?("account:#{@id}:regeneration")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ class PublishAnnouncementReactionWorker
|
|||
payload = Oj.dump(event: :'announcement.reaction', payload: payload)
|
||||
|
||||
FeedManager.instance.with_active_accounts do |account|
|
||||
redis.publish("timeline:#{account.id}", payload) if redis.exists("subscribed:timeline:#{account.id}")
|
||||
redis.publish("timeline:#{account.id}", payload) if redis.exists?("subscribed:timeline:#{account.id}")
|
||||
end
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
true
|
||||
|
|
|
@ -15,7 +15,7 @@ class PublishScheduledAnnouncementWorker
|
|||
payload = Oj.dump(event: :announcement, payload: payload)
|
||||
|
||||
FeedManager.instance.with_active_accounts do |account|
|
||||
redis.publish("timeline:#{account.id}", payload) if redis.exists("subscribed:timeline:#{account.id}")
|
||||
redis.publish("timeline:#{account.id}", payload) if redis.exists?("subscribed:timeline:#{account.id}")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ class UnpublishAnnouncementWorker
|
|||
payload = Oj.dump(event: :'announcement.delete', payload: announcement_id.to_s)
|
||||
|
||||
FeedManager.instance.with_active_accounts do |account|
|
||||
redis.publish("timeline:#{account.id}", payload) if redis.exists("subscribed:timeline:#{account.id}")
|
||||
redis.publish("timeline:#{account.id}", payload) if redis.exists?("subscribed:timeline:#{account.id}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue