Skip to content

Commit 4f8e508

Browse files
committed
#4 - configure database only when successfully connected
1 parent 820e87c commit 4f8e508

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/TgDatabase/Database.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ protected function connect(\TgUtils\Auth\CredentialsProvider $provider = NULL) {
4848
);
4949
if ($this->con->connect_errno) {
5050
error_log('Failed to connect to MySQL: '.$this->con->connect_errno);
51+
} else {
52+
$this->configureConnection();
5153
}
52-
$this->configureConnection();
5354
}
5455
}
5556

0 commit comments

Comments
 (0)