Use imported namespaces, don't fully qualify
[lhc/web/wiklou.git] / includes / libs / objectcache / CachedBagOStuff.php
index 798357d..60ec922 100644 (file)
@@ -21,8 +21,6 @@
  * @ingroup Cache
  */
 
-use Psr\Log\LoggerInterface;
-
 /**
  * Wrapper around a BagOStuff that caches data in memory
  *
@@ -50,11 +48,9 @@ class CachedBagOStuff extends HashBagOStuff {
 
        protected function doGet( $key, $flags = 0 ) {
                $ret = parent::doGet( $key, $flags );
-               if ( $ret === false ) {
+               if ( $ret === false && !$this->hasKey( $key ) ) {
                        $ret = $this->backend->doGet( $key, $flags );
-                       if ( $ret !== false ) {
-                               $this->set( $key, $ret, 0, self::WRITE_CACHE_ONLY );
-                       }
+                       $this->set( $key, $ret, 0, self::WRITE_CACHE_ONLY );
                }
                return $ret;
        }