Closed yayaigo2010 closed 8 years ago
Try to add codes like bellow in start_gateway.php
...
$gateway->onWorkerStop = function($gateway)
{
// record shut down time only in process of zero
if($gateway->id === 0)
{
// record server shut down time
}
};
...
You can get operating system shut down time by file /var/log/messages.
I already add these code below,but when I stop server, it doesn't show "start_gateway.php onWorkerStop" in my log.
$gateway->onWorkerStop = function($gateway) { echo "start_gateway.php onWorkerStop \n"; // record shut down time only in process of zero if($gateway->id === 0) { // record server shut down time echo "start_gateway.php onWorkerStop 2\n"; } };
May be the version you used does not support。 Update to the latest version will work.
Is there a server stop callback function in GatewayWorker? because I want to record server shut down time, when restart server, use the shut down time to recalculate the end time of my gameplay event.
Another question,If operating system or web server(nginx) restart, how can I know the server previous shut down time?