take db config into account for cache key

This commit is contained in:
Thomas Portelange 2024-03-21 16:14:06 +01:00 committed by GitHub
parent 89195568a3
commit 5680733eb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -82,7 +82,8 @@ class ClassInfo
public static function hasTable($tableName)
{
$cache = self::getCache();
$cacheKey = 'tableList';
$configData = serialize(DB::getConfig());
$cacheKey = 'tableList_' . md5($configData);
$tableList = $cache->get($cacheKey) ?? [];
if (empty($tableList) && DB::is_active()) {
$tableList = DB::get_schema()->tableList();