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 39b1c2b commit ca7047fCopy full SHA for ca7047f
src/Mutex.php
@@ -20,12 +20,16 @@ class Mutex
20
public function __construct(Command $command)
21
{
22
$this->command = $command;
23
- $this->strategy = $this->strategy();
+ $this->strategy = $this->getStrategy();
24
$this->ninja = new Ninja($command->getMutexName(), $this->strategy);
25
}
26
27
- private function strategy()
+ public function getStrategy()
28
29
+ if (!empty($this->strategy)) {
30
+ return $this->strategy;
31
+ }
32
+
33
switch ($this->command->getMutexStrategy()) {
34
case 'mysql':
35
return new MySqlLock(env('DB_USERNAME'), env('DB_PASSWORD'), env('DB_HOST'));
0 commit comments