@@ -14,11 +14,11 @@ |
||
| 14 | 14 | __DIR__ . '/../config/supercache.php', |
| 15 | 15 | 'supercache' |
| 16 | 16 | ); |
| 17 | - $this->app->singleton(SuperCacheManager::class, function ($app) { |
|
| 17 | + $this->app->singleton(SuperCacheManager::class, function($app) { |
|
| 18 | 18 | return new SuperCacheManager(new RedisConnector()); |
| 19 | 19 | }); |
| 20 | 20 | |
| 21 | - $this->app->singleton('supercache', function ($app) { |
|
| 21 | + $this->app->singleton('supercache', function($app) { |
|
| 22 | 22 | return new SuperCacheManager(new RedisConnector()); |
| 23 | 23 | }); |
| 24 | 24 | } |
@@ -198,7 +198,7 @@ |
||
| 198 | 198 | $async_connection = $this->redis->getNativeRedisConnection($this->option('connection_name'), $this->option('host'), $this->option('port')); |
| 199 | 199 | $pattern = '__keyevent@' . $async_connection['database'] . '__:expired'; |
| 200 | 200 | // La psubscribe è BLOCCANTE, il command resta attivo finchè non cade la connessione |
| 201 | - $async_connection['connection']->psubscribe([$pattern], function ($redis, $channel, $message, $key) { |
|
| 201 | + $async_connection['connection']->psubscribe([$pattern], function($redis, $channel, $message, $key) { |
|
| 202 | 202 | $advancedMode = config('supercache.advancedMode', 0) === 1; |
| 203 | 203 | if ($advancedMode) { |
| 204 | 204 | $this->onExpireEvent($key); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $isCluster = config('database.redis.clusters.' . ($connection_name ?? 'default')) !== null; |
| 87 | 87 | $advancedMode = (int) config('supercache.advancedMode', 0) === 1; |
| 88 | 88 | if (!$isCluster) { |
| 89 | - $this->redis->pipeline(function ($pipe) use ($finalKey, $value, $tags, $ttl, $advancedMode) { |
|
| 89 | + $this->redis->pipeline(function($pipe) use ($finalKey, $value, $tags, $ttl, $advancedMode) { |
|
| 90 | 90 | if ($ttl !== null) { |
| 91 | 91 | $pipe->setEx($finalKey, $ttl, $this->serializeForRedis($value)); |
| 92 | 92 | } else { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $tags = $this->redis->getRedisConnection($connection_name)->smembers($this->prefix . 'tags:' . $finalKey); |
| 185 | 185 | $isCluster = config('database.redis.clusters.' . ($connection_name ?? 'default')) !== null; |
| 186 | 186 | if (!$isCluster) { |
| 187 | - $this->redis->pipeline(function ($pipe) use ($tags, $finalKey) { |
|
| 187 | + $this->redis->pipeline(function($pipe) use ($tags, $finalKey) { |
|
| 188 | 188 | foreach ($tags as $tag) { |
| 189 | 189 | $shard = $this->getShardNameForTag($tag, $finalKey); |
| 190 | 190 | $pipe->srem($shard, $finalKey); |