Drop support for openswoole

This commit is contained in:
Alejandro Celaya
2024-02-16 23:02:46 +01:00
parent 72c4628b79
commit 96ed7cae0d
33 changed files with 26 additions and 369 deletions

View File

@@ -20,7 +20,6 @@ use Shlinkio\Shlink\IpGeolocation\GeoLite2\DbUpdater;
use Shlinkio\Shlink\IpGeolocation\GeoLite2\GeoLite2Options;
use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface;
use function Shlinkio\Shlink\Config\runningInOpenswoole;
use function Shlinkio\Shlink\Config\runningInRoadRunner;
return (static function (): array {
@@ -47,7 +46,7 @@ return (static function (): array {
];
// Send visits to matomo asynchronously if the runtime allows it
if (runningInRoadRunner() || runningInOpenswoole()) {
if (runningInRoadRunner()) {
$asyncEvents[EventDispatcher\Event\VisitLocated::class][] = EventDispatcher\Matomo\SendVisitToMatomo::class;
} else {
$regularEvents[EventDispatcher\Event\VisitLocated::class] = [EventDispatcher\Matomo\SendVisitToMatomo::class];

View File

@@ -57,7 +57,7 @@ class UrlShortener implements UrlShortenerInterface
$this->eventDispatcher->dispatch(new ShortUrlCreated($newShortUrl->getId()));
} catch (ContainerExceptionInterface $e) {
// Ignore container errors when dispatching the event.
// When using openswoole, this event will try to enqueue a task, which cannot be done outside an HTTP
// When using RoadRunner, this event will try to enqueue a task, which cannot be done outside an HTTP
// request.
// If the short URL is created from CLI, the event dispatching will fail.
return UrlShorteningResult::withErrorOnEventDispatching($newShortUrl, $e);