/log/*
!/log/.keep
/tmp
-coverage
-public/system
-public/assets
-public/packs
-public/packs-test
+/coverage
+/public/system
+/public/assets
+/public/packs
+/public/packs-test
.env
.env.production
.env.development
-node_modules/
-build/
+/node_modules/
+/build/
# Ignore Vagrant files
.vagrant/
# Ignore Capistrano customizations
-config/deploy/*
+/config/deploy/*
# Ignore IDE files
.vscode/
.idea/
# Ignore postgres + redis + elasticsearch volume optionally created by docker-compose
-postgres
-redis
-elasticsearch
+/postgres
+/redis
+/elasticsearch
# ignore Helm lockfile, dependency charts, and local values file
-chart/Chart.lock
-chart/charts/*.tgz
-chart/values.yaml
+/chart/Chart.lock
+/chart/charts/*.tgz
+/chart/values.yaml
# Ignore Apple files
.DS_Store
rack (>= 1.0, < 3)
rack-cors (1.1.1)
rack (>= 2.0.0)
- rack-protection (2.0.8.1)
- rack
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
nokogiri (>= 1.8.0)
nokogumbo (~> 2.0)
semantic_range (2.3.0)
- sidekiq (6.0.7)
+ sidekiq (6.1.0)
connection_pool (>= 2.2.2)
rack (~> 2.0)
- rack-protection (>= 2.0.0)
- redis (>= 4.1.0)
+ redis (>= 4.2.0)
sidekiq-bulk (0.2.0)
sidekiq
sidekiq-scheduler (3.0.1)
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)
end
def processed?
- redis.exists("move_in_progress:#{@account.id}")
+ redis.exists?("move_in_progress:#{@account.id}")
end
def mark_as_processing!
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)
end
def subscribed_to_timeline?
- Redis.current.exists("subscribed:#{streaming_channel}")
+ Redis.current.exists?("subscribed:#{streaming_channel}")
end
def streaming_channel
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
end
def regenerating?
- redis.exists("account:#{@id}:regeneration")
+ redis.exists?("account:#{@id}:regeneration")
end
end
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
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
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
Bundler.require(*Rails.groups)
require_relative '../app/lib/exceptions'
+require_relative '../lib/redis/namespace_extensions'
require_relative '../lib/paperclip/url_generator_extensions'
require_relative '../lib/paperclip/attachment_extensions'
require_relative '../lib/paperclip/media_type_spoof_detector_extensions'
# frozen_string_literal: true
-Redis.exists_returns_integer = false
-
redis_connection = Redis.new(
url: ENV['REDIS_URL'],
driver: :hiredis
--- /dev/null
+# frozen_string_literal: true
+
+class Redis
+ module NamespaceExtensions
+ def exists?(*args, &block)
+ call_with_namespace('exists?', *args, &block)
+ end
+ end
+end
+
+Redis::Namespace::COMMANDS['exists?'] = [:first]
+Redis::Namespace.prepend(Redis::NamespaceExtensions)