WEB: Catch all cache driver errors for fallback

This commit is contained in:
Mataniko committed 2020-10-05 00:11:33 -04:00
1 parent e82e0d397d
commit 7025c556b7
1 file changed
+2 -2
+2 -2
View File
@@ -3,7 +3,7 @@ namespace ScummVM\Models;
use Phpfastcache\Helper\Psr16Adapter;
use Phpfastcache\Drivers\Redis\Config;
use Phpfastcache\Exceptions\PhpfastcacheDriverConnectException;
use Phpfastcache\Exceptions\PhpfastcacheDriverException;
abstract class BasicModel
{
@@ -16,7 +16,7 @@ abstract class BasicModel
$database = $_SERVER['HTTP_HOST'] === 'www.scummvm.org' ? 8 : 7;
$config = new Config(['database' => $database]);
self::$cache = new Psr16Adapter('redis', $config);
} catch (PhpfastcacheDriverConnectException $ex) {
} catch (PhpfastcacheDriverException $ex) {
// Fallback to files based cache
self::$cache = new Psr16Adapter('files');
}