Skip to content

Commit 7a68e0c

Browse files
committed
ICM: mysql strategy implemented.
1 parent caf3581 commit 7a68e0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Mutex.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Console\Command;
66
use NinjaMutex\Lock\FlockLock;
7+
use NinjaMutex\Lock\MySqlLock;
78
use NinjaMutex\Mutex as Ninja;
89
use NinjaMutex\MutexException;
910

@@ -28,7 +29,7 @@ private function strategy()
2829

2930
switch ($this->command->getMutexStrategy()) {
3031
case 'mysql':
31-
throw new MutexException('Strategy `mysql` is not implemented yet.');
32+
return new MySqlLock(env('DB_USERNAME'), env('DB_PASSWORD'), env('DB_HOST'));
3233

3334
case 'redis':
3435
throw new MutexException('Strategy `redis` is not implemented yet.');

0 commit comments

Comments
 (0)