$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.
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
I think the proper way to do this would be changing your design so the event runs for all the users and then determines which user(s) to run the event for (if any). Also, the way Laravel handles scheduled tasks in different than the way Linux handles Cron jobs.
As an example:
If you have the following code in the app/Console/Kernel.php
file and run php artisan schedule:run
, the job is ran.
$schedule->job(new IntegrateJob, 'integrationId')->cron('* * * * *');
If you take out the above code and run php artisan schedule:run
after a minute, the job will not be ran because Laravel does not persist the job.