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)
49
49
case 'api_excel ' : // api_excel 列表完成率
50
50
$ user_id = $ userInfo ['id ' ];
51
51
$ server ->push ($ request ->fd , $ this ->apiExcel ($ user_id ));
52
- go (function () use ($ server , $ request , $ user_id ) {
52
+ // go(function() use ($server, $request, $user_id) {
53
53
while (true ) {
54
54
// 创建协程 - 睡眠操作影响 worker 进程
55
55
// Coroutine::sleep(5);
56
56
sleep (5 );
57
57
$ state = ApiExcel::where ('state ' , 1 )->first ();
58
58
if (!$ state ) {
59
59
$ server ->push ($ request ->fd , $ this ->apiExcel ($ user_id ));
60
- return ;
60
+ return '' ;
61
61
}
62
62
// 每个用户 fd 限制请求次数
63
63
$ redisKey = 'websocket_fd_ ' .$ request ->fd ;
@@ -72,19 +72,19 @@ public function onOpen(Server $server, Request $request)
72
72
$ this ->redis ->expire ($ redisKey , 600 );
73
73
}
74
74
if ($ count > 20000 ) { // 防止刷单的安全拦截
75
- return ; // 超出就跳出循环
75
+ return '' ; // 超出就跳出循环
76
76
}
77
77
} else {
78
78
$ count_fd = 'count_ ' .$ request ->fd ;
79
79
$ this ->incrKey ($ count_fd );
80
80
// 单fd超过 1000 次跳出循环
81
81
if ($ this ->$ count_fd > 1000 ) {
82
82
unset($ this ->$ count_fd );
83
- return ;
83
+ return '' ;
84
84
}
85
85
}
86
86
}
87
- });
87
+ // });
88
88
}
89
89
return '' ;
90
90
You can’t perform that action at this time.
0 commit comments