我的sidekiq worker的请求对象被识别为字符串。
application_controller.rb
def log_variant
@request = request
AnalyticsWorker.perform_async(@request)
end
variant_worker.rb
class VariantWorker
include Sidekiq::Worker
def perform(current_request)
variant = current_request.variant.join
puts variant
end
end
这是错误
undefined method `variant' for "#<ActionDispatch::Request:0x00000101b83510>":String
我将请求对象存储在实例变量中,所以我应该能够调用变量方法吗?请求对象是否太复杂而无法执行此sidekiq操作?