Fix single Redis connection being used across all threads (#18135)
* Fix single Redis connection being used across all Sidekiq threads * Fix tests
This commit is contained in:
@@ -4,6 +4,8 @@ module AccessTokenExtension
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
include Redisable
|
||||
|
||||
after_commit :push_to_streaming_api
|
||||
end
|
||||
|
||||
@@ -16,6 +18,6 @@ module AccessTokenExtension
|
||||
end
|
||||
|
||||
def push_to_streaming_api
|
||||
Redis.current.publish("timeline:access_token:#{id}", Oj.dump(event: :kill)) if revoked? || destroyed?
|
||||
redis.publish("timeline:access_token:#{id}", Oj.dump(event: :kill)) if revoked? || destroyed?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user