Skip to content

Commit

Permalink
style: fix styleCI errors
Browse files Browse the repository at this point in the history
refactor: remove uneeded cast of flag

The collectionExists flag was already cast as false, so recasting it
serves no purpose
  • Loading branch information
tharropoulos committed Jul 10, 2024
1 parent 38e0423 commit ca8ea59
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Engines/TypesenseEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,12 @@ protected function getOrCreateCollectionFromModel($model, bool $indexOperation =
if ($collection->exists()) {
// Also check if the collection exists in Typesense to avoid potential errors
$collectionName = $model->{$method}();
try {

try {
$this->typesense->collections[$collectionName]->retrieve();
$collectionExists = true;
} catch (TypesenseClientError $e){
$collectionExists = false;
} catch (TypesenseClientError $e) {
// No need to do anything here, collectionExists will remain false
}
}

Expand Down

0 comments on commit ca8ea59

Please sign in to comment.