diff --git a/src/classes/Controllers/Console/DirectoryAdd.php b/src/classes/Controllers/Console/DirectoryAdd.php index 6e9fc30..6845397 100644 --- a/src/classes/Controllers/Console/DirectoryAdd.php +++ b/src/classes/Controllers/Console/DirectoryAdd.php @@ -54,17 +54,17 @@ HELP; $directory_url = $this->getArgument(0); - $result = $this->atlas->perform('INSERT IGNORE INTO `directory_poll_queue` SET + $affected = $this->atlas->fetchAffected('INSERT IGNORE INTO `directory_poll_queue` SET `directory_url` = :directory_url', ['directory_url' => $directory_url] ); - if (!$result) { - throw new \RuntimeException('Unable to add repository with URL: ' . $directory_url); + if (!$affected) { + $this->out('Directory already exists in the queue.'); + } else { + $this->out('Successfully added the directory to the queue.'); } - $this->out('Successfully added the repository to the queue.'); - return 0; } }