mercredi 18 septembre 2019

Laravel Not able to dispatch job from crontab

if i use this code in a controller queuing works well

 $job=(new ReProcessShipment($single_data->request_data))->delay(2);
 $this->dispatch($job);

but using same code in crontab error throws

Method App\Console\Commands\AddPreProcess::dispatch does not exist. {"exception":"[object] (BadMethodCallException(code: 0):
Method App\Console\Commands\AddPreProcess::dispatch does not exist.

tried to use it like

 $job=(new ReProcessShipment($single_data->request_data))->delay(2);
 ReProcessShipment::dispatch($job);

then get error

Object of class App\Jobs\ReProcessShipment could not be converted to string {"exception":"[object] (ErrorException(code: 0): Object of class App\Jobs\ReProcessShipment could not be converted to string at

am not able to process job queue from a cronjob any suggestion would be great.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire