mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-11-18 21:35:12 +00:00
WEB: Catch all cache driver errors for fallback
This commit is contained in:
1 parent
e82e0d397d
commit
7025c556b7
1 file changed
+2
-2
@@ -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');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user