Try setting signal handler before passing control to loop
This commit is contained in:
parent
a81cd4c221
commit
c4cf967198
@ -71,8 +71,7 @@ class Postgres
|
|||||||
|
|
||||||
while (yield $result->advance()) {
|
while (yield $result->advance()) {
|
||||||
$row = $result->getCurrent();
|
$row = $result->getCurrent();
|
||||||
if ($row===false)
|
if ($row===false) {
|
||||||
{
|
|
||||||
yield $connection->query("
|
yield $connection->query("
|
||||||
CREATE DATABASE {$db}
|
CREATE DATABASE {$db}
|
||||||
OWNER {$user}
|
OWNER {$user}
|
||||||
|
@ -9,7 +9,6 @@ use Amp\Sql\ResultSet;
|
|||||||
use danog\MadelineProto\Logger;
|
use danog\MadelineProto\Logger;
|
||||||
use function Amp\call;
|
use function Amp\call;
|
||||||
|
|
||||||
|
|
||||||
class PostgresArray implements DbArray
|
class PostgresArray implements DbArray
|
||||||
{
|
{
|
||||||
use ArrayCacheTrait;
|
use ArrayCacheTrait;
|
||||||
@ -39,7 +38,8 @@ class PostgresArray implements DbArray
|
|||||||
|
|
||||||
$this->setCache($index, $value);
|
$this->setCache($index, $value);
|
||||||
|
|
||||||
$request = $this->request("
|
$request = $this->request(
|
||||||
|
"
|
||||||
INSERT INTO \"{$this->table}\"
|
INSERT INTO \"{$this->table}\"
|
||||||
(key,value)
|
(key,value)
|
||||||
VALUES (:index, :value)
|
VALUES (:index, :value)
|
||||||
|
@ -23,8 +23,6 @@ use danog\Loop\ResumableSignalLoop;
|
|||||||
use danog\MadelineProto\Loop\InternalLoop;
|
use danog\MadelineProto\Loop\InternalLoop;
|
||||||
use danog\MadelineProto\MTProto;
|
use danog\MadelineProto\MTProto;
|
||||||
|
|
||||||
use function Amp\delay;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update feed loop.
|
* Update feed loop.
|
||||||
*
|
*
|
||||||
|
@ -28,7 +28,6 @@ use danog\MadelineProto\Db\DbArray;
|
|||||||
use danog\MadelineProto\Db\DbPropertiesFabric;
|
use danog\MadelineProto\Db\DbPropertiesFabric;
|
||||||
use danog\MadelineProto\Db\DbPropertiesTrait;
|
use danog\MadelineProto\Db\DbPropertiesTrait;
|
||||||
use danog\MadelineProto\Db\Mysql;
|
use danog\MadelineProto\Db\Mysql;
|
||||||
use danog\MadelineProto\Db\Pgsql;
|
|
||||||
use danog\MadelineProto\Ipc\Server;
|
use danog\MadelineProto\Ipc\Server;
|
||||||
use danog\MadelineProto\Loop\Generic\PeriodicLoopInternal;
|
use danog\MadelineProto\Loop\Generic\PeriodicLoopInternal;
|
||||||
use danog\MadelineProto\Loop\Update\FeedLoop;
|
use danog\MadelineProto\Loop\Update\FeedLoop;
|
||||||
|
@ -262,6 +262,8 @@ class Magic
|
|||||||
if (\defined(\SIGINT::class)) {
|
if (\defined(\SIGINT::class)) {
|
||||||
//if (function_exists('pcntl_async_signals')) pcntl_async_signals(true);
|
//if (function_exists('pcntl_async_signals')) pcntl_async_signals(true);
|
||||||
try {
|
try {
|
||||||
|
\pcntl_signal(SIGINT, fn () => null);
|
||||||
|
\pcntl_signal(SIGINT, SIG_DFL);
|
||||||
Loop::unreference(Loop::onSignal(SIGINT, static function () {
|
Loop::unreference(Loop::onSignal(SIGINT, static function () {
|
||||||
Logger::log('Got sigint', Logger::FATAL_ERROR);
|
Logger::log('Got sigint', Logger::FATAL_ERROR);
|
||||||
Magic::shutdown(1);
|
Magic::shutdown(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user