Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nelson-ph/833d7536227b8fd9e31a2fbd649073d9 to your computer and use it in GitHub Desktop.

Select an option

Save nelson-ph/833d7536227b8fd9e31a2fbd649073d9 to your computer and use it in GitHub Desktop.
Drupal 8 - Redis cluster - add prediscluster doDeleteMultiple support
Index: src/Cache/PredisCluster.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Cache/PredisCluster.php b/src/Cache/PredisCluster.php
--- a/src/Cache/PredisCluster.php (date 1623849227261)
+++ b/src/Cache/PredisCluster.php (date 1623849227261)
@@ -27,4 +27,18 @@
parent::__construct($bin, $client, $checksum_provider, $serializer);
}
-}
\ No newline at end of file
+ /**
+ * {@inheritdoc}
+ */
+ public function doDeleteMultiple(array $cids) {
+ if (!empty($cids)) {
+ $keys = array_map([$this, 'getKey'], $cids);
+ $pipe = $this->client->pipeline();
+ foreach ($keys as $key){
+ $pipe->del($key);
+ }
+ $pipe->execute();
+ }
+ }
+
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment