mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 23:43:12 +00:00
add logger on mysql timeout and check appbox connection on subdefsjob
This commit is contained in:
@@ -68,6 +68,8 @@ class SubdefsJob extends AbstractJob
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$app->getApplicationBox()->get_connection();
|
||||||
|
|
||||||
foreach ($app->getDataboxes() as $databox) {
|
foreach ($app->getDataboxes() as $databox) {
|
||||||
if (!$this->isStarted()) {
|
if (!$this->isStarted()) {
|
||||||
break;
|
break;
|
||||||
|
@@ -140,6 +140,10 @@ abstract class base implements cache_cacheableInterface
|
|||||||
public function get_connection()
|
public function get_connection()
|
||||||
{
|
{
|
||||||
if($this->connection->ping() === false){
|
if($this->connection->ping() === false){
|
||||||
|
if(isset($this->app['task-manager.logger'])){
|
||||||
|
$this->app['task-manager.logger']->info("MySQL server is not available : close and connect .....");
|
||||||
|
}
|
||||||
|
|
||||||
$this->connection->close();
|
$this->connection->close();
|
||||||
$this->connection->connect();
|
$this->connection->connect();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user