Closed gennadiylitvinyuk closed 1 year ago
Hello, blocking store is not required, it was fixed in docs and code do not acquire blocking locks. preventOverlapping
should deliver same functionality as onOneServer
.
Did you test preventOverlapping
with remote store like PDO?
Unfortunately I didn't mention it, I refer to 3.4 but in 3.5 it is still the same
The check for BlockingStoreInterface is still there, if I understand it correctly.
And yes, I tried it with PDO Store
The check for BlockingStoreInterface is still there, if I understand it correctly.
Yes, but StoreInterface
is also accepted. Symfony changed Lock component in 5.x.
And yes, I tried it with PDO Store
Does it work?
No, at least in v3.4 (PHP 7.4) there is no 'Symfony\Component\Lock\StoreInterface
available.
That leads for example to Exception
In Event.php line 729:
Instance of 'Symfony\Component\Lock\BlockingStoreInterface' or 'Symfony\Component\Lock\StoreInterface' is expected, 'Symfony\Component\Lock\Store\DoctrineDbalStore' provided
Which Symfony Lock version?
Which Symfony Lock version?
symfony/lock v5.4.10
OK, looks like bug in Crunz, will be fixed soon.
@gennadiylitvinyuk please try https://github.com/crunzphp/crunz/pull/44
@gennadiylitvinyuk please try #44
Yes, it works this way
Description
An option to indicate that the task should run on only one server, similar to laravel's onOneServer like described in https://laravel.com/docs/9.x/scheduling#running-tasks-on-one-server
It is not possible to achieve the same results with
preventOverlapping
because the current implementation ofpreventOverlapping
allows passing only locks implementing BlockingStoreInterface. It leads task execution once per server, but not in the same time.