updated contrib modules : translation_views, views_bulk_edit, views_bulk_operations, workflow, addtoany, redis, url_to_video_filter
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Drupal\redis\Cache;
|
||||
|
||||
use \DateInterval;
|
||||
use Drupal\Component\Assertion\Inspector;
|
||||
use Drupal\Component\Serialization\SerializationInterface;
|
||||
use Drupal\Core\Cache\Cache;
|
||||
use Drupal\Core\Cache\CacheBackendInterface;
|
||||
@@ -297,7 +298,7 @@ abstract class CacheBase implements CacheBackendInterface {
|
||||
// Always add a cache tag for the current bin, so that we can use that for
|
||||
// invalidateAll().
|
||||
$tags[] = $this->getTagForBin();
|
||||
assert('\Drupal\Component\Assertion\Inspector::assertAllStrings($tags)', 'Cache Tags must be strings.');
|
||||
assert(Inspector::assertAllStrings($tags), 'Cache Tags must be strings.');
|
||||
$hash = [
|
||||
'cid' => $cid,
|
||||
'created' => round(microtime(TRUE), 3),
|
||||
|
||||
@@ -84,8 +84,8 @@ class Predis extends LockBackendAbstract {
|
||||
// succeed if the key does not exist yet.
|
||||
$result = $this->client->set($key, $id, 'nx', 'px', (int) ($timeout * 1000));
|
||||
|
||||
// If the result is FALSE, we failed to acquire the lock.
|
||||
if (FALSE === $result) {
|
||||
// If the result is FALSE or NULL, we failed to acquire the lock.
|
||||
if (FALSE === $result || NULL === $result) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\redis\PersistentLock;
|
||||
|
||||
use Drupal\redis\ClientFactory;
|
||||
|
||||
/**
|
||||
* Predis persistent lock backend
|
||||
*/
|
||||
class Predis extends \Drupal\redis\Lock\Predis {
|
||||
|
||||
/**
|
||||
* Creates a Predis persistent lock backend.
|
||||
*/
|
||||
public function __construct(ClientFactory $factory) {
|
||||
// Do not call the parent constructor to avoid registering a shutdown
|
||||
// function that releases all the locks at the end of a request.
|
||||
$this->client = $factory->getClient();
|
||||
// Set the lockId to a fixed string to make the lock ID the same across
|
||||
// multiple requests. The lock ID is used as a page token to relate all the
|
||||
// locks set during a request to each other.
|
||||
// @see \Drupal\Core\Lock\LockBackendInterface::getLockId()
|
||||
$this->lockId = 'persistent';
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user