Fix coroutine DB timeout leakage

This commit is contained in:
Chirag Aggarwal
2026-04-06 19:34:07 +05:30
parent b71e4d8659
commit dda7c4c875
2 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -26,6 +26,7 @@ use Appwrite\Network\Platform;
use Appwrite\Network\Validator\Origin;
use Appwrite\Network\Validator\Redirect;
use Appwrite\Usage\Context as UsageContext;
use Appwrite\Utopia\Database\Adapter\Pool as DatabasePool;
use Appwrite\Utopia\Database\Documents\User;
use Appwrite\Utopia\Request;
use Appwrite\Utopia\Response;
@@ -42,7 +43,6 @@ use Utopia\Auth\Proofs\Token;
use Utopia\Auth\Store;
use Utopia\Cache\Cache;
use Utopia\Config\Config;
use Utopia\Database\Adapter\Pool as DatabasePool;
use Utopia\Database\Database;
use Utopia\Database\DateTime as DatabaseDateTime;
use Utopia\Database\Document;
@@ -0,0 +1,22 @@
<?php
namespace Appwrite\Utopia\Database\Adapter;
use Utopia\Database\Database;
class Pool extends \Utopia\Database\Adapter\Pool
{
public function setTimeout(int $milliseconds, string $event = Database::EVENT_ALL): void
{
$this->timeout = $milliseconds;
$this->delegate(__FUNCTION__, \func_get_args());
}
public function clearTimeout(string $event = Database::EVENT_ALL): void
{
$this->timeout = 0;
$this->delegate(__FUNCTION__, \func_get_args());
}
}