mardi 8 mai 2018

Laravel 5.6 Delete schedules in the code

I have a API where a user create integrations.

Those integrations may have recurrence (repeat every 6 months, every 2 days, etc).

  • In the UI when the user selects when to repeat is generated a cron (ex: * * * * *).
  • The recurrence is managed by the laravel schedule (https://laravel.com/docs/5.6/scheduling)
  • That cron is saved in the configurations of that integration of the user

EX: then in the Kernel.php :

$schedule->job(new IntegrateJob, 'integrationId')->cron('* * * * *');

Easy... I works!!!

But if the user deletes the integrations (soft delete), then I dont want to run that job in the selected cron.

I want to delete that entry in the laravel scheduler.

But that info is not saved anywhere, not in the database, not in cache, not in the redis server that manages the jobs...

If I cant find them I cant delete them... Any Solutions? Thank U



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire