lavary/crunz

onOneServer

MarcosGrzeca opened this issue · 6 comments

Description
An option to indicate that the task should run on only one server, similar to laravel onOneServer.

Exactly, but in the crunz package.

I prefer crunz, because Laravel doesn't have a method to list cron operations.

Actually it is implemented in Crunz, but with different name, preventOverlapping, https://github.com/lavary/crunz#parallelism-and-the-locking-mechanism. To make sure task runs on only one server you should use one of external (remote) lock store https://symfony.com/doc/current/components/lock.html#available-stores, like PDO, Redis or Memcached.

Issue looks like resolved to me, in case of more questions feel free to open new one, I'm closing this one.

The current implementation of preventOverlapping allows passing only locks implementing BlockingStoreInterface.

In ths way it is not possible to use preventOverlapping to implement something like onOneServer, because it leads to double execution - once per server, but not in the same time.

Hello @gennadiylitvinyuk, this package is not maintained anymore, please add new issue in https://github.com/crunzphp/crunz.