symfony / panther

A browser testing and web crawling library for PHP and Symfony
MIT License
2.91k stars 213 forks source link

Using Panther in Messenger #584

Closed KDederichs closed 1 year ago

KDederichs commented 1 year ago

Hey,

I'm wondering if it's possible to use Panther inside Messenger (async) for scrapping purposes.

I'm currently running into the issue that the very first message works just fine but every request after runs into an exception:

["class" => "App\Message\CrawlJob","retryCount" => 2,"delay" => 2000,"error" => "Handling "App\Message\CrawlJob" failed: The port 9515 is already in use.","exception" => Symfony\Component\Messenger\Exception\HandlerFailedException { …}]

I probably can get around it by restarting the messenger after every task but I'd like to avoid that if possible :)

KDederichs commented 1 year ago

Never mind, just found the quit method.