Skip to content

Commit 0c1fe3a

Browse files
authored
Merge pull request #3 from OpenConext/feature/support-custom-query
Prevent 'Aborted connection' warnings from the DoctrineConnectionHealthCheck
2 parents 7dfec45 + 70bf029 commit 0c1fe3a

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
# 1.0.4
1+
# Changelog
2+
3+
## 1.0.5
4+
Take two of improving the DoctrineConnectionHealthCheck
5+
6+
## 1.0.4
27
Removed RMT from the project
38

4-
# 1.0.3
9+
## 1.0.3
510
The main change in this release is the improvement of the query that is executed by the DoctrineConnectionHealthCheck. It now uses the SchemaManager to grab a table from the available schemas and performs a SELECT * FROM [table] LIMIT 1 on that table.
611

7-
VERSION 1 RELEASE OF A NEW VERSION
8-
===================================
12+
### 1.0.2
13+
Updated README.md
14+
15+
### 1.0.1
16+
Symfony 3 support
917

10-
Version 1.0.0 - Release of a new version
11-
18/12/2017 16:17 1.0.2 Updated README.md
12-
11/12/2017 11:16 1.0.1 Symfony 3 support
13-
07/12/2017 14:41 1.0.0 initial release
18+
### 1.0.0
19+
Initial release

src/HealthCheck/DoctrineConnectionHealthCheck.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@ public function check(HealthReportInterface $report)
5858
$table = reset($tables);
5959
// Perform a light-weight query on the chosen table
6060
$query = 'SELECT * FROM `%s` LIMIT 1';
61-
$this->entityManager->getConnection()->exec(sprintf($query, $table->getName()));
61+
$this->entityManager->getConnection()->query(sprintf($query, $table->getName()));
6262
}
6363
} catch (Exception $e) {
64-
// On error close the connection to prevent sleeping processes
65-
$this->entityManager->getConnection()->close();
6664
return HealthReport::buildStatusDown('Unable to execute a query on the database.');
6765
}
6866
}

0 commit comments

Comments
 (0)