From 7dc4f6c83291b005cce83249564ad8a22da51e50 Mon Sep 17 00:00:00 2001 From: Daimona Eaytoy Date: Sun, 14 Apr 2019 19:13:48 +0200 Subject: [PATCH] Cache: Make APCUBagOStuff::set return a useful value It took me lots of time to debug a CI failure in I9b3bc36b552901bc6ca7609ee51e80be2979a9c4. I was deceived by $cache->set returning true, which according to the docs means that the store was successful. But instead, this function just returns true, even in case of failure. Make it return the result of apcu_store, which is already in the format true = success, false = failure. Change-Id: I2619845c12460e1acb5af696d2c11a5a4dee1bd3 --- includes/libs/objectcache/APCUBagOStuff.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/includes/libs/objectcache/APCUBagOStuff.php b/includes/libs/objectcache/APCUBagOStuff.php index 0483ee7ef2..ed4eb35cd7 100644 --- a/includes/libs/objectcache/APCUBagOStuff.php +++ b/includes/libs/objectcache/APCUBagOStuff.php @@ -54,13 +54,11 @@ class APCUBagOStuff extends BagOStuff { } public function set( $key, $value, $exptime = 0, $flags = 0 ) { - apcu_store( + return apcu_store( $key . self::KEY_SUFFIX, $this->serialize( $value ), $exptime ); - - return true; } public function add( $key, $value, $exptime = 0, $flags = 0 ) { -- 2.20.1