mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 00:55:35 +08:00
Add error exit code
This commit is contained in:
@@ -26,9 +26,10 @@ use function substr;
|
|||||||
class ZMUtil
|
class ZMUtil
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* @param mixed $error_exit
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function stop()
|
public static function stop($error_exit = false)
|
||||||
{
|
{
|
||||||
if (SpinLock::tryLock('_stop_signal') === false) {
|
if (SpinLock::tryLock('_stop_signal') === false) {
|
||||||
return;
|
return;
|
||||||
@@ -37,7 +38,7 @@ class ZMUtil
|
|||||||
if (Console::getLevel() >= 4) {
|
if (Console::getLevel() >= 4) {
|
||||||
Console::trace();
|
Console::trace();
|
||||||
}
|
}
|
||||||
ZMAtomic::get('stop_signal')->set(1);
|
ZMAtomic::get('stop_signal')->set($error_exit ? 2 : 1);
|
||||||
server()->shutdown();
|
server()->shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user