mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Fixed #8526 - skip cache for setup check
This commit is contained in:
parent
6b1f1a29ef
commit
e80b63b5c1
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue