File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -194,14 +194,7 @@ protected function flushValues()
194194 ->chunk (1000 );
195195
196196 foreach ($ entries as $ cacheKeys ) {
197- $ connection = $ this ->store ->connection ();
198- if ($ connection instanceof PredisClusterConnection) {
199- foreach ($ cacheKeys as $ cacheKey ) {
200- $ connection ->del ($ cacheKey );
201- }
202- } else {
203- $ connection ->del (...$ cacheKeys );
204- }
197+ $ this ->store ->connection ()->del (...$ cacheKeys );
205198 }
206199 }
207200
Original file line number Diff line number Diff line change @@ -62,4 +62,21 @@ public function transaction(?callable $callback = null)
6262 // p does not support transacation for Redis Cluster
6363 return tap ($ this , $ callback );
6464 }
65+
66+ /**
67+ * Execute commands in a transaction.
68+ *
69+ * @param string[]|string $keyOrKeys
70+ * @param string ...$keys
71+ * @return int
72+ */
73+ public function del ($ keyOrKeys , ...$ keys )
74+ {
75+ // p does not support transacation for Redis Cluster
76+ $ deleted = 0 ;
77+ foreach (array_merge (Arr::wrap ($ keyOrKeys ), $ keys ) as $ cacheKey ) {
78+ $ deleted += parent ::del ($ cacheKey );
79+ }
80+ return $ deleted ;
81+ }
6582}
You can’t perform that action at this time.
0 commit comments