Avoid closing connection if in worker
This commit is contained in:
parent
e5c430dfc9
commit
f18e197319
@ -20,6 +20,7 @@
|
|||||||
namespace danog\MadelineProto\Wrappers;
|
namespace danog\MadelineProto\Wrappers;
|
||||||
|
|
||||||
use Amp\Promise;
|
use Amp\Promise;
|
||||||
|
use danog\MadelineProto\Magic;
|
||||||
use danog\MadelineProto\Settings;
|
use danog\MadelineProto\Settings;
|
||||||
use danog\MadelineProto\Shutdown;
|
use danog\MadelineProto\Shutdown;
|
||||||
|
|
||||||
@ -180,7 +181,7 @@ trait Loop
|
|||||||
*/
|
*/
|
||||||
public function closeConnection($message = 'OK!')
|
public function closeConnection($message = 'OK!')
|
||||||
{
|
{
|
||||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' || isset($GLOBALS['exited']) || \headers_sent()) {
|
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' || isset($GLOBALS['exited']) || \headers_sent() || isset($_GET['MadelineSelfRestart']) || Magic::$isIpcWorker) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->logger->logger($message);
|
$this->logger->logger($message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user