@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | class CleanOrphanedKeysCommand extends Command |
10 | 10 | { |
11 | - protected $signature = 'supercache:clean-orphans {--connection_name= : (opzionale) nome della connessione redis}' ; |
|
11 | + protected $signature = 'supercache:clean-orphans {--connection_name= : (opzionale) nome della connessione redis}'; |
|
12 | 12 | protected $description = 'Clean orphaned cache keys'; |
13 | 13 | protected RedisConnector $redis; |
14 | 14 | protected int $numShards; |
@@ -151,7 +151,7 @@ |
||
151 | 151 | // Pattern per ascoltare solo gli eventi expired |
152 | 152 | $pattern = '__keyevent@' . $async_connection['database'] . '__:expired'; |
153 | 153 | // Sottoscrizione agli eventi di scadenza |
154 | - $async_connection['connection']->psubscribe([$pattern], function ($redis, $channel, $message, $key) { |
|
154 | + $async_connection['connection']->psubscribe([$pattern], function($redis, $channel, $message, $key) { |
|
155 | 155 | $this->onExpireEvent($key); |
156 | 156 | |
157 | 157 | // Verifica se è necessario processare il batch |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $finalKey = $this->getFinalKey($key); |
70 | 70 | // Usa pipeline solo se non è un cluster |
71 | 71 | if (!$this->isCluster) { |
72 | - $this->redis->pipeline(function ($pipe) use ($finalKey, $value, $tags, $ttl) { |
|
72 | + $this->redis->pipeline(function($pipe) use ($finalKey, $value, $tags, $ttl) { |
|
73 | 73 | $pipe->set($finalKey, $this->serializeForRedis($value)); |
74 | 74 | |
75 | 75 | if ($ttl !== null) { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $tags = $this->redis->getRedisConnection($connection_name)->smembers($this->prefix . 'tags:' . $finalKey); |
157 | 157 | |
158 | 158 | if (!$this->isCluster) { |
159 | - $this->redis->pipeline(function ($pipe) use ($tags, $finalKey) { |
|
159 | + $this->redis->pipeline(function($pipe) use ($tags, $finalKey) { |
|
160 | 160 | foreach ($tags as $tag) { |
161 | 161 | $shard = $this->getShardNameForTag($tag, $finalKey); |
162 | 162 | $pipe->srem($shard, $finalKey); |
@@ -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 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | -1, // Timeout connessione |
40 | 40 | -1, // Timeout lettura |
41 | 41 | true, // Persistente |
42 | - ($config[0]['password'] !== null && $config[0]['password'] !== '' ? $config[0]['password'] : null) // Password se necessaria |
|
42 | + ($config[0]['password'] !== null && $config[0]['password'] !== '' ? $config[0]['password'] : null) // Password se necessaria |
|
43 | 43 | ); |
44 | 44 | |
45 | 45 | // Nel cluster c'è sempre un unico databse |