Skip to content

EspoCRM – Open Source CRM Application

Clear cache try cache

Yurii67e24911b5b1
diff --git a/application/Espo/Core/DataManager.php b/application/Espo/Core/DataManager.php
index 4b30a9df76..a409586a79 100644
--- a/application/Espo/Core/DataManager.php
+++ b/application/Espo/Core/DataManager.php
@@ -117,9 +117,15 @@ class DataManager
throw new Error("Could not clear system cache.", previous: $e);
}
- $dataCache = $this->dataCacheProvider->get();
+ try {
+ $dataCache = $this->dataCacheProvider->get();
+ } catch (Throwable $e) {
+ $this->log->error("Could not get application data cache.", ['exception' => $e]);
+
+ $dataCache = null;
+ }
- if ($this->systemDataCache !== $dataCache) {
+ if ($dataCache && $this->systemDataCache !== $dataCache) {
try {
$dataCache->clearAll();
} catch (PersistenceError $e) {