Compare commits
3 Commits
e498990393
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 89efba8a82 | |||
| 7fbc1a364d | |||
| 378b0f5e4b |
@@ -96,13 +96,18 @@ class JobInspector
|
|||||||
$basePath = str_replace($file->getBasename(), '', $file->getBasePath());
|
$basePath = str_replace($file->getBasename(), '', $file->getBasePath());
|
||||||
$name = $basePath . $file->getFilename();
|
$name = $basePath . $file->getFilename();
|
||||||
$className = str_replace('/', '\\', $basePath) . $file->getFilename();
|
$className = str_replace('/', '\\', $basePath) . $file->getFilename();
|
||||||
$classPath = "\\$sprinkleNS\\Worker\\Jobs\\$className";
|
$classPath = "\\$sprinkleNS\\Jobs\\$className";
|
||||||
|
|
||||||
// Exclude known helper classes
|
// Exclude known helper classes
|
||||||
if ($className == "JobInterface" || $className == "JobBase" || $className == "JobInspector") {
|
if ($className == "JobInterface" || $className == "JobBase" || $className == "JobInspector") {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$reflect = new \ReflectionClass($classPath);
|
||||||
|
if ($reflect->isAbstract()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// Build the class name and namespace
|
// Build the class name and namespace
|
||||||
return [
|
return [
|
||||||
'sprinkle' => $sprinkleName,
|
'sprinkle' => $sprinkleName,
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ class Worker
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->queuedJob->save();
|
$this->queuedJob->save();
|
||||||
} catch(Exception $ex) {
|
} catch(\Exception $ex) {
|
||||||
if ($this->debug) $this->debug->error('Job execution failed!', [$ex]);
|
if ($this->debug) $this->debug->error('Job execution failed!', [$ex]);
|
||||||
|
|
||||||
$io->error('An exception occurred attempting to run a job');
|
$io->error('An exception occurred attempting to run a job');
|
||||||
|
|||||||
Reference in New Issue
Block a user