synolia / SyliusSchedulerCommandPlugin

Schedule Symfony Commands in your Sylius
MIT License
30 stars 20 forks source link

[Feature] give possibility to run multiple instances on one server #88

Open olivierharo opened 11 months ago

olivierharo commented 11 months ago

Is your feature request related to a problem? Please describe. I have two websites hosted on the same server. I can't run twho schedulers

Describe the solution you'd like In this file vendor/synolia/sylius-scheduler-command-plugin/src/Command/SynoliaSchedulerRunCommand.php replace if (!$this->lock() { by if (!$this->lock(realpath(dirname(FILE)))) {

oallain commented 11 months ago

Hello,

This function is already available. The plugin is based on symfony/lock, for which you can configure where the "lock" is stored.

In your case you can do : On website A :

#.env.local
LOCK_DSN='flock:///path/to/websiteA'

and, on website B :

#.env.local
LOCK_DSN='flock:///path/to/websiteB'

See documentation for more details.

Regards