Skip to content

Commit b8a6d9d

Browse files
authored
Merge pull request #116 from bavix/cc
fix config wallet.lock.cache
2 parents df46d01 + d825a76 commit b8a6d9d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

config/config.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,16 @@
2727

2828
/**
2929
* Lock settings for highload projects
30+
*
31+
* If you want to replace the default cache with another,
32+
* then write the name of the driver cache in the key `wallet.lock.cache`.
33+
* @see https://laravel.com/docs/6.x/cache#driver-prerequisites
34+
*
35+
* @example
36+
* 'cache' => 'redis'
3037
*/
3138
'lock' => [
32-
'cache' => 'memcached',
39+
'cache' => null,
3340
'enabled' => false,
3441
'seconds' => 1,
3542
],

src/Services/LockService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct()
3434
*/
3535
public function lock($self, string $name, \Closure $closure)
3636
{
37-
return $this->lockProvider($self, $name, (int)config('wallet.lock.seconds'))
37+
return $this->lockProvider($self, $name, (int)config('wallet.lock.seconds', 1))
3838
->get($this->bindTo($self, $closure));
3939
}
4040

tests/TestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ protected function getEnvironmentSetUp($app): void
8181

8282
if (extension_loaded('memcached')) {
8383
$app['config']->set('cache.default', 'memcached');
84+
$app['config']->set('wallet.lock.cache', 'memcached');
8485
}
8586

8687
$app['config']->set('cache.stores.memcached', [

0 commit comments

Comments
 (0)