Skip to content

Commit 9938f67

Browse files
author
Till Brehm
committed
Fixed: FS#3189 - APS Installation Issues
1 parent b002da1 commit 9938f67

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

server/lib/classes/aps_installer.inc.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,19 @@ private function prepareDatabase($task, $sxe)
370370

371371
$tmp = $app->db->queryOneRecord("SELECT value FROM aps_instances_settings WHERE name = 'main_database_login' AND instance_id = '".$app->db->quote($task['instance_id'])."';");
372372
$newdb_login = $tmp['value'];
373+
374+
/* Test if the new mysql connection is laready working to ensure that db servers in multiserver
375+
setups get enough time to create the database */
376+
for($n = 1; $n < 15; $n++) {
377+
$mysqli = new mysqli($newdb_host, $newdb_login, $newdb_pw, $newdb_name);
378+
if ($mysqli->connect_error) {
379+
unset($mysqli);
380+
sleep(5);
381+
} else {
382+
unset($mysqli);
383+
break;
384+
}
385+
}
373386

374387
$this->putenv[] = 'DB_'.$db_id.'_TYPE=mysql';
375388
$this->putenv[] = 'DB_'.$db_id.'_NAME='.$newdb_name;

0 commit comments

Comments
 (0)