Status: Updated cache check to use unique key

Updated status endpoint cache check to include a random component in the
key to avoid conflict during simultaneous checks.
For #4396
This commit is contained in:
Dan Brown 2023-08-17 21:24:35 +01:00
parent fef433a9cb
commit e44ef57219
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -20,10 +20,11 @@ class StatusController extends Controller
return DB::table('migrations')->count() > 0; return DB::table('migrations')->count() > 0;
}), }),
'cache' => $this->trueWithoutError(function () { 'cache' => $this->trueWithoutError(function () {
$rand = Str::random(); $rand = Str::random(12);
Cache::add('status_test', $rand); $key = "status_test_{$rand}";
Cache::add($key, $rand);
return Cache::pull('status_test') === $rand; return Cache::pull($key) === $rand;
}), }),
'session' => $this->trueWithoutError(function () { 'session' => $this->trueWithoutError(function () {
$rand = Str::random(); $rand = Str::random();