File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,15 @@ public function onOpen(Server $server, Request $request)
4949 case 'api_excel ' : // api_excel 列表完成率
5050 $ user_id = $ userInfo ['id ' ];
5151 $ server ->push ($ request ->fd , $ this ->apiExcel ($ user_id ));
52- go (function () use ($ server , $ request , $ user_id ) {
52+ // go(function() use ($server, $request, $user_id) {
5353 while (true ) {
5454 // 创建协程 - 睡眠操作影响 worker 进程
5555 // Coroutine::sleep(5);
5656 sleep (5 );
5757 $ state = ApiExcel::where ('state ' , 1 )->first ();
5858 if (!$ state ) {
5959 $ server ->push ($ request ->fd , $ this ->apiExcel ($ user_id ));
60- return ;
60+ return '' ;
6161 }
6262 // 每个用户 fd 限制请求次数
6363 $ redisKey = 'websocket_fd_ ' .$ request ->fd ;
@@ -72,19 +72,19 @@ public function onOpen(Server $server, Request $request)
7272 $ this ->redis ->expire ($ redisKey , 600 );
7373 }
7474 if ($ count > 20000 ) { // 防止刷单的安全拦截
75- return ; // 超出就跳出循环
75+ return '' ; // 超出就跳出循环
7676 }
7777 } else {
7878 $ count_fd = 'count_ ' .$ request ->fd ;
7979 $ this ->incrKey ($ count_fd );
8080 // 单fd超过 1000 次跳出循环
8181 if ($ this ->$ count_fd > 1000 ) {
8282 unset($ this ->$ count_fd );
83- return ;
83+ return '' ;
8484 }
8585 }
8686 }
87- });
87+ // });
8888 }
8989 return '' ;
9090
You can’t perform that action at this time.
0 commit comments