Closed anchovy closed 6 years ago
Hi
Still an ongoing requirement; anybody able to help?
Regards Ben
@anchovy - how is $schedule being defined in this function? I'll bet all that needs to happen is the defineConsoleSchedule()
IOC definition in the readme needs to be applied to the AppServiceProvider::register() function - could you try that and see if it resolves it?
$this->app->instance(
'Illuminate\Console\Scheduling\Schedule', $schedule = new \jdavidbakr\MultiServerEvent\Scheduling\Schedule
);
Closing this issue, this package is deprecated as of Laravel 5.6
Hi
This is exactly what I'm looking for with our app being load balanced on AWS with 2 instances minimum. We've a couple of 'cron' that need to be daily, but once only when run as a cron, i.e. not once per server.
Currently these can also be called as api routes from the admin dashboard - so they are accessible through the controller route and the scheduler is calling them via this method i.e.:
$schedule->call(function () { //update any 'old' messages to archived. DB::table('table')->where('archived','=',0)->where('live',0)->update(array('archived'=>1, 'active'=>0)); })->name('daily')->withoutOverlapping()->daily();
So - be great to be able to call once accross all servers i.e.
$schedule->call(function () { //update any 'old' messages to archived. DB::table('table')->where('archived','=',0)->where('live',0)->update(array('archived'=>1,'active'=>0)); })->everyMinute()->withoutOverlappingMultiServer();
But this is throwing the error:
So - any pointers for getting this to work on the ->call() method?
Thanks in advance.