We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ba8abe commit 3a0203bCopy full SHA for 3a0203b
src/mutex/MySQLMutex.php
@@ -43,9 +43,15 @@ public function lock(): void
43
{
44
$statement = $this->pdo->prepare('SELECT GET_LOCK(?,?)');
45
46
+ // MySQL rounds the value to whole seconds, sadly rounds, not ceils
47
+ // TODO MariaDB supports microseconds precision since 10.1.2 version,
48
+ // but we need to detect the support reliably first
49
+ // https://github.com/MariaDB/server/commit/3e792e6cbccb5d7bf5b84b38336f8a40ad232020
50
+ $timeoutInt = (int) ceil($this->timeout);
51
+
52
$statement->execute([
53
$this->name,
- $this->timeout,
54
+ $timeoutInt,
55
]);
56
57
$statement->setFetchMode(\PDO::FETCH_NUM);
0 commit comments