Skip to content

Commit 1f020e5

Browse files
authored
fix: prevent division by zero by ensuring minimum thread count of 1 (#710)
Set threads to at least 1 when configuration returns 0 to avoid division by zero error in file processing batch calculation.
1 parent cf9481e commit 1f020e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Domain/Runner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct(OutputInterface $output, FilesRepository $filesRepos
5757

5858
$this->configuration = $container->get(Configuration::class);
5959
$this->cacheKey = $this->configuration->getCacheKey();
60-
$this->threads = $this->configuration->getNumberOfThreads();
60+
$this->threads = max(1, $this->configuration->getNumberOfThreads());
6161
}
6262

6363
/**

0 commit comments

Comments
 (0)