修改变量,打包发布
This commit is contained in:
parent
a0f1958bf5
commit
d496491479
|
@ -13,7 +13,7 @@ class Index
|
|||
'code' => 200,
|
||||
'msg' => 'success',
|
||||
'data' => [
|
||||
'name' => 'thinkphp6'
|
||||
'name' => 'thinkphp'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class Index
|
|||
"url" => 'http://' . $serverIP . '/' . $savename,
|
||||
// "url" => 'http://192.168.1.105:8080/file/' . $savename,
|
||||
],
|
||||
'env' => $env->get(),
|
||||
// 'env' => $env->get(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,9 +15,9 @@ Route::post('/file/upload', 'index/upload');
|
|||
Route::post('/upload', 'index/upload');
|
||||
|
||||
Route::get('/actuator/health', function () {
|
||||
return 'hello,ThinkPHP6!';
|
||||
return 'hello,ThinkPHP!';
|
||||
});
|
||||
|
||||
Route::get('/actuator/info', function () {
|
||||
return 'hello,ThinkPHP6!';
|
||||
return 'hello,ThinkPHP!';
|
||||
});
|
||||
|
|
10
start.php
10
start.php
|
@ -26,8 +26,8 @@ $task->onWorkerStart = function(Worker $task) use ($serverAddr, $nacosAddr)
|
|||
"base_uri" => $nacosAddr,
|
||||
"timeout" => 5
|
||||
]);
|
||||
// 每2.5秒执行一次
|
||||
Timer::add(5, function() use ($client, $serverAddr)
|
||||
// 心跳检测,每8秒执行一次
|
||||
Timer::add(8, function() use ($client, $serverAddr)
|
||||
{
|
||||
list ($serverIP, $serverPort) = explode(':', $serverAddr);
|
||||
$response = $client->request("put", "/nacos/v1/ns/instance/beat", [
|
||||
|
@ -48,9 +48,9 @@ $task->onWorkerStart = function(Worker $task) use ($serverAddr, $nacosAddr)
|
|||
}'
|
||||
],
|
||||
]);
|
||||
echo "send heartbeat: " . $response->getBody()->getContents() . "\n";
|
||||
echo json_encode($_ENV, JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
|
||||
echo "\n";
|
||||
// echo "send heartbeat: " . $response->getBody()->getContents() . "\n";
|
||||
// echo json_encode($_ENV, JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
|
||||
// echo "\n";
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue