Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inc/cluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function downloadFiles() {
$bar->end();
}

private function downloadnopoen($hash) {
public function downloadnopoen($hash) {
global $DOWNLOAD_DIR;
global $tokendata;
$filePath = $DOWNLOAD_DIR . '/' . substr($hash, 0, 2) . '/';
Expand Down
22 changes: 17 additions & 5 deletions inc/socketio.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function connect() {
}

while(true) {
$alldata = $client->recv(1.5);
$alldata = $client->recv(1);
if (!is_bool($alldata)){
$this->data = $data = $alldata->data;
preg_match('/^\d+/', $data, $code);
Expand Down Expand Up @@ -76,7 +76,7 @@ public function connect() {
});
}
elseif (isset($jsondata[0][1]) && $jsondata[0][1] == "0"){
mlog("[socket.io]主控返回节点已掉线");
mlog("[socket.io]节点已掉线");
global $pid;
posix_kill($pid, SIGINT);
}
Expand All @@ -86,6 +86,11 @@ public function connect() {
}
elseif (isset($jsondata[0][0]["message"])){
mlog("[socket.io]Got data {$jsondata[0][0]["message"]}");
if (strpos($jsondata[0][0]["message"], "Error") !== false) {
mlog("[socket.io]节点启用失败");
global $pid;
posix_kill($pid, SIGINT);
}
}
else {
mlog("[socket.io]Got data {$data}");
Expand All @@ -94,15 +99,22 @@ public function connect() {
}
if ($code[0] == '423'){
$data = substr($data, strlen($code[0]));
mlog("[socket.io]Got data {$data}");
if(isset($jsondata[0][0]["message"])){
mlog("[socket.io]Got data {$jsondata[0][0]["message"]}");
}
else{
mlog("[socket.io]Got data {$data}");
}
}
//var_dump($data);
Coroutine::sleep(0.1);
}
global $shouldExit;
global $httpserver;
if ($shouldExit) {
Swoole\Timer::clear($katimeid);
global $enable;
if($enable){
Swoole\Timer::clear($katimeid);
}
$this->disable();
$httpserver->stopserver();
return;
Expand Down
1 change: 1 addition & 0 deletions main.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use function Swoole\Coroutine\run;
use function Swoole\Timer;
declare(ticks=1)
date_default_timezone_set('Asia/Shanghai');
set_time_limit(0);
ini_set('memory_limit', '-1');
require './config.php';
Expand Down