Fixed #8526 - skip cache for setup check

This commit is contained in:
snipe 2020-10-19 12:33:38 -07:00
parent 6b1f1a29ef
commit e80b63b5c1

View file

@ -117,18 +117,20 @@ class Setting extends Model
*/
public static function setupCompleted(): bool
{
return Cache::rememberForever(self::SETUP_CHECK_KEY, function () {
try {
$usercount = User::withTrashed()->count();
$settingsCount = self::count();
\Log::debug('User table and settings table exist and have records.');
\Log::debug('Settings: '.$settingsCount );
\Log::debug('Users: '.$usercount );
return $usercount > 0 && $settingsCount > 0;
} catch (\Throwable $th) {
// Catche the error if the tables dont exit
\Log::debug('User table and settings table DO NOT exist or DO NOT have records');
// Catch the error if the tables dont exit
return false;
}
return false;
});
}
/**