Skip to content

Commit

Permalink
Merge pull request #2 from manticoresoftware/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
djklim87 authored Sep 6, 2022
2 parents 64f02d0 + 1e86d70 commit 96c8bdc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Manticore/ManticoreConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,20 @@ public function addTableToCluster($tableName, $log = true): bool

protected function query($sql, $logQuery = true, $attempts = 0)
{
$result = $this->connection->query($sql);
try {
if ($logQuery) {
Analog::log('Query: '.$sql);
}
$result = $this->connection->query($sql);

if ($logQuery) {
Analog::log('Query: '.$sql);
} catch (\Exception $exception) {
Analog::log("Exception until query processing. Query: ".$sql."\n. Error: ".$exception);
if ($attempts > $this->maxAttempts) {
throw new \RuntimeException("Can't process query ".$sql);
}
}


if ($this->getConnectionError()) {
Analog::log("Error until query processing. Query: ".$sql."\n. Error: ".$this->getConnectionError());
if ($attempts > $this->maxAttempts) {
Expand All @@ -229,6 +237,7 @@ protected function query($sql, $logQuery = true, $attempts = 0)
return $this->query($sql, $logQuery, $attempts);
}


return $result;
}

Expand Down
7 changes: 7 additions & 0 deletions src/Manticore/ManticoreStreamsJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ public function __construct($clusterName, NotificationInterface $notification, $
parent::__construct($clusterName, $binaryPort);

$this->notification = $notification;
$testsIndexMetadata = '/var/lib/manticore/tests/tests.meta';
if (file_exists($testsIndexMetadata)){
Analog::log('Tests metadata ' . file_get_contents($testsIndexMetadata));
}else{
Analog::log('Tests metadata not found');
}

$this->restoreExistingIndexes();
}

Expand Down

0 comments on commit 96c8bdc

Please sign in to comment.