Skip to content

Commit

Permalink
ClassifierJob: Stop classify job if model is disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Sep 23, 2022
1 parent c56a97a commit 6f964f3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/BackgroundJobs/ClassifierJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public function __construct(ITimeFactory $time, LoggerInterface $logger, QueueSe
protected function runClassifier(string $model, $argument) {
$storageId = $argument['storageId'];
$rootId = $argument['rootId'];
if ($this->config->getAppValue('recognize', $model.'.enabled', 'false') !== 'true') {
$this->logger->debug('Not classifying files of storage '.$storageId. ' using '.$model. ' because model is disabled');
// `static` to get extending subclass name
$this->jobList->remove(static::class, $argument);
return;
}
$this->logger->debug('Classifying files of storage '.$storageId. ' using '.$model);
try {
$files = $this->queue->getFromQueue($model, $storageId, $rootId, $this->getBatchSize());
Expand Down

0 comments on commit 6f964f3

Please sign in to comment.