Commit 38c8b9b8 authored by dodozhang21's avatar dodozhang21 Committed by Jeremy Andrews

Issue #2879600 by dodozhang21, osopolar: Call to a member function getStats() on boolean

parent 28c22500
...@@ -13,10 +13,10 @@ require_once dirname(__FILE__) . '/dmemcache.inc'; ...@@ -13,10 +13,10 @@ require_once dirname(__FILE__) . '/dmemcache.inc';
// http://drupal.org/node/1225404 // http://drupal.org/node/1225404
$lock_file = dirname(__FILE__) . '/memcache-lock-code.inc'; $lock_file = dirname(__FILE__) . '/memcache-lock-code.inc';
$mc = dmemcache_object('semaphore'); $mc = dmemcache_object('semaphore');
// dmemcache_object always returns TRUE, we don't need these stats but it forces // dmemcache_object may return FALSE, we don't need these stats but it forces
// us to try and connect to memcache. If this fails, we can't store locks in // us to try and connect to memcache. If this fails, we can't store locks in
// memcache. // memcache.
if (!$mc->getStats()) { if (!$mc || !$mc->getStats()) {
$lock_file = DRUPAL_ROOT . '/includes/lock.inc'; $lock_file = DRUPAL_ROOT . '/includes/lock.inc';
} }
require_once $lock_file; require_once $lock_file;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment