Hi,
I am trying to find out what should I do in case only-one callable job is failed:
$scheduler = new Scheduler();
$scheduler->call(function () {
// ...
throw new \Exception();
// ...
}, [], 'job-id')->onlyOne();
$scheduler->run();
In this case lock file remains untouched and the job will not be executed again until I delete the lock file manually. I would like to change this behavior and let the job run again even if previous execution has failed. To do this I need to know the location of the lock file, but the Job class doesn't seem to provide that capability.
I ended up with the following hack:
foreach ($scheduler->getFailedJobs() as $failedJob) {
unlink('/tmp/' . $failedJob->getJob()->getId() . '.lock');
}
Do you think it makes sense to allow the client code to access lock file path or maybe call removeLockFile() from the outside?
Hi,
I am trying to find out what should I do in case only-one callable job is failed:
In this case lock file remains untouched and the job will not be executed again until I delete the lock file manually. I would like to change this behavior and let the job run again even if previous execution has failed. To do this I need to know the location of the lock file, but the Job class doesn't seem to provide that capability.
I ended up with the following hack:
Do you think it makes sense to allow the client code to access lock file path or maybe call removeLockFile() from the outside?