Reverted concurrent popup lookup
All checks were successful
Push image to registry / build-image (push) Successful in 3m6s

This commit is contained in:
2025-11-01 16:48:17 +01:00
parent eb141f00e5
commit c36d83e8b6

View File

@@ -10,7 +10,6 @@ use App\Notification\Providers\AllNotification;
use Facebook\WebDriver\WebDriverBy;
use Illuminate\Contracts\Queue\ShouldBeUniqueUntilProcessing;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Concurrency;
use Illuminate\Support\Facades\Log;
use Laravel\Dusk\Browser;
use App\Services\AIPrompt\OpenAPIPrompt;
@@ -108,22 +107,9 @@ abstract class InstagramAbstractJob extends BrowserJob implements ShouldBeUnique
['//button|//div[contains(text(), "OK")]', ["Popup Ok clicked"]], // OK
];
$fn = [];
foreach ($popupsTypes as $popup) {
$fn[] = function () use ($browser, $popup) {
try {
return $browser->driver->findElement(WebDriverBy::xpath($popup[0]));
} catch (\Exception $e) {
return null;
}
};
}
$buttons = Concurrency::run($fn);
foreach ($popupsTypes as $index => $popup) {
try {
$button = $buttons[$index] ?? null;
$button = $browser->driver->findElement(WebDriverBy::xpath($popup[0]));
if ($button === null) {
continue; // No button found, continue to the next popup
}