gateway推送数据,使用redis缓存时不时的爆出错误:
RedisException: read error on connection in /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/cache/driver/Redis.php:121
Stack trace:
#0 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/cache/driver/Redis.php(121): Redis->setex('cc_table_member...', 18000, 1543818152)
#1 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/Cache.php(148): think\cache\driver\Redis->set('table_members_2...', 1543818152, 18000)
#2 /data/wwwroot/test2.tigerisa.com/application/push/controller/Events.php(298): think\Cache::set('table_members_2...', 1543818152, 18000)
#3 [internal function]: app\push\controller\Events::onClose('7f0000010f3d000...')
#4 /data/wwwroot/test2.tigerisa.com/vendor/workerman/gateway-worker/src/BusinessWorker.php(409): call_user_func('\\app\\push\\contr...', '7f0000010f3d000...')
#5 [internal function]: GatewayWorker\BusinessWorker->onGatewayMessage(Object(Workerman\Connection\AsyncTcpConnection), Array)
#6 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Connection/TcpConnection.php(650): call_user_func(Array, Object(Workerman\Connection\AsyncTcpConnection), Array)
#7 [internal function]: Workerman\Connection\TcpConnection->baseRead(Resource id #103)
#8 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Events/Select.php(295): call_user_func_array(Array, Array)
#9 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Worker.php(2323): Workerman\Events\Select->loop()
#10 /data/wwwroot/test2.tigerisa.com/vendor/workerman/gateway-worker/src/BusinessWorker.php(197): Workerman\Worker->run()
#11 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Worker.php(1452): GatewayWorker\BusinessWorker->run()
#12 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Worker.php(1282): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\BusinessWorker))
#13 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Worker.php(1256): Workerman\Worker::forkWorkersForLinux()
#14 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Worker.php(507): Workerman\Worker::forkWorkers()
#15 /data/wwwroot/test2.tigerisa.com/application/push/controller/Run.php(62): Workerman\Worker::runAll()
#16 [internal function]: app\push\controller\Run->__construct()
#17 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/App.php(359): ReflectionClass->newInstanceArgs(Array)
#18 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/Loader.php(479): think\App::invokeClass('app\\push\\contro...')
#19 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/App.php(575): think\Loader::controller('run', 'controller', false, 'Error')
#20 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/App.php(456): think\App::module(Array, Array, true)
#21 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/App.php(139): think\App::exec(Array, Array)
#22 /data/wwwroot/test2.tigerisa.com/thinkphp/start.php(19): think\App::run()
#23 /data/wwwroot/test2.tigerisa.com/public/server.php(50): require('/data/wwwroot/t...')
#24 {main}
Worker[10879] process terminated
导致进程终止。
通过百度我做了几番努力:
1、 设置缓存时间 Cache::set($key,json_encode($value,JSON_UNESCAPED_UNICODE),18000);------------------没卵用
2、 ini_set('default_socket_timeout', -1); //不超时 设置不超时-------------------------------------验证中。。。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。