Skip to content
Snippets Groups Projects
Commit 1615bff6 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

fixed cpu usage problem when waiting for bv

parent c5b4df09
No related branches found
No related tags found
No related merge requests found
......@@ -74,6 +74,7 @@ class BrowserVerification
$js_enabled = true;
}
$bv_result = $this->waitForBV($key, false, $js_enabled);
if ($bv_result) {
\app()->make(SearchSettings::class)->header_printed = false;
\app()->make(QueryTimer::class)->observeEnd(self::class);
......@@ -140,7 +141,13 @@ class BrowserVerification
do {
usleep(10 * 1000);
// Calculate Sleep Time
// Sleeptime gradually increases with the current wait time
// Min 10ms and max 1s
$sleep_time_milliseconds = round(now()->diffInMilliseconds($wait_start) / 10);
$sleep_time_milliseconds = max(10, $sleep_time_milliseconds);
$sleep_time_milliseconds = min(1000, $sleep_time_milliseconds);
usleep($sleep_time_milliseconds * 1000);
$bvData = Cache::get($key);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment