mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
fix: throw InvalidArgumentException for non-positive timeouts
Previously readTimeout <= 0 was silently coerced to 0.25s. Better to fail loudly so misconfiguration surfaces during testing rather than masking the user's intent at runtime. Apply the same rule to the connect timeout. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
611c141612
commit
2dbb72833a
1 file changed
+4
-1
@@ -56,8 +56,11 @@ class Multiplexing implements Adapter, TelemetryFeature
|
||||
private string|array|null $auth = null,
|
||||
private int $dbIndex = 0,
|
||||
) {
|
||||
if ($this->timeout <= 0) {
|
||||
throw new \InvalidArgumentException('timeout must be greater than 0');
|
||||
}
|
||||
if ($this->readTimeout <= 0) {
|
||||
$this->readTimeout = 0.25;
|
||||
throw new \InvalidArgumentException('readTimeout must be greater than 0');
|
||||
}
|
||||
$this->sendLock = new Lock();
|
||||
$this->setTelemetry(new NoTelemetry());
|
||||
|
||||
Reference in new issue
Block a user