如果代码执行redis相关函数,会引发Redis::InheritedError:Triedtouseaconnectionfromachildprocesswithoutreconnecting.YouneedtoreconnecttoRedisafterforking.当redis连接时它会将sporkprocess.pid保存为@pid,然后redis执行它会使用ensure_connected检查连接,这将通过Process.pid!=@pid检查。这两个pid是不同的,所以它会引发Redis::InheritedError。Google一下,Resque.after_fork
如果代码执行redis相关函数,会引发Redis::InheritedError:Triedtouseaconnectionfromachildprocesswithoutreconnecting.YouneedtoreconnecttoRedisafterforking.当redis连接时它会将sporkprocess.pid保存为@pid,然后redis执行它会使用ensure_connected检查连接,这将通过Process.pid!=@pid检查。这两个pid是不同的,所以它会引发Redis::InheritedError。Google一下,Resque.after_fork
每当我调用Sidekiqworker时,我都会收到以下错误:Redis::InheritedError(Triedtouseaconnectionfromachildprocesswithoutreconnecting.YouneedtoreconnecttoRedisafterforking.)我在Heroku上托管并使用通过connection_poolgem连接到的RedisCloud。这是redis.rb:ifRails.configuration.redis_uri.present?$redis=ConnectionPool.new(:size=>8,:timeout=>30