Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The README currently has this:
## LOCKS ##
Memcache locks can be enabled through the services.yml file.
services:
# Replaces the default lock backend with a memcache implementation.
lock:
class: Drupal\Core\Lock\LockBackendInterface
factory: memcache.lock.factory:get
# Replaces the default persistent lock backend with a memcache implementation.
lock.persistent:
class: Drupal\Core\Lock\LockBackendInterface
factory: memcache.lock.factory:getPersistent
...but it looks like if you copy and paste that into services.yml without removing the extra level of indentation, it silently does nothing.
Remove the extra pair of spaces before each line, and the memcache lock backend gets picked up by Drupal (you need to rebuild cache to make sure the container is rebuilt).
Patch on the way to remove the extra whitespace.
Comment | File | Size | Author |
---|---|---|---|
#2 | remove_whitespace-2909178-2.patch | 1.03 KB | mcdruid |
Comments
Comment #2
mcdruidComment #3
anavarreComment #4
mcdruidIf anyone wants to test this, if you only put the memcache lock lines (with the extra whitespace) into services.yml you'll get an error:
...but if there's something before the memcache lines e.g.
...there's no error, but neither will the memcache lock backend be registered / used.
Comment #5
adammaloneAgreed, this should be committed (albeit with changes already committed in #2852460: Document Locking Backend). Alternatively, the README could suggest adding a separate file for inclusion in settings.php e.g.
settings.php
sites/default/memcache.services.yml
Comment #6
catchPatch didn't quite apply but given this was just an indentation change, did it locally. Committed/pushed to 8.x-2.x, thanks!