Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UDR
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-UDR
Commits
79115a81
Commit
79115a81
authored
Jun 22, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update debug message
parent
5836d7d3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/udr_app/mysql_db.cpp
src/udr_app/mysql_db.cpp
+7
-6
No files found.
src/udr_app/mysql_db.cpp
View file @
79115a81
...
...
@@ -58,17 +58,18 @@ mysql_db::~mysql_db() {
//------------------------------------------------------------------------------
bool
mysql_db
::
initialize
()
{
Logger
::
udr_mysql
().
debug
(
"Initializ
e MySQL DB
"
);
Logger
::
udr_mysql
().
debug
(
"Initializ
ing MySQL DB ...
"
);
if
(
!
mysql_init
(
&
mysql_connector
))
{
Logger
::
udr_mysql
().
error
(
"Cannot initialize MySQL"
);
throw
std
::
runtime_error
(
"Cannot initialize MySQL"
);
}
Logger
::
udr_mysql
().
debug
(
"Done!"
);
return
true
;
}
//------------------------------------------------------------------------------
bool
mysql_db
::
connect
(
uint32_t
num_retries
)
{
Logger
::
udr_mysql
().
debug
(
"Connect to MySQL DB"
);
Logger
::
udr_mysql
().
debug
(
"Connect
ing
to MySQL DB"
);
int
i
=
0
;
while
(
i
<
num_retries
)
{
...
...
@@ -77,13 +78,12 @@ bool mysql_db::connect(uint32_t num_retries) {
udr_cfg
.
mysql
.
mysql_user
.
c_str
(),
udr_cfg
.
mysql
.
mysql_pass
.
c_str
(),
udr_cfg
.
mysql
.
mysql_db
.
c_str
(),
0
,
0
,
0
))
{
Logger
::
udr_mysql
().
error
(
"An error occurred wh
ile connecting to MySQL DB: %s
, retry ..."
,
"An error occurred wh
en connecting to MySQL DB (%s)
, retry ..."
,
mysql_error
(
&
mysql_connector
));
i
++
;
// throw std::runtime_error("Cannot connect to MySQL DB");
}
else
{
Logger
::
udr_mysql
().
info
(
"Connected to MySQL DB: %s:"
,
mysql_error
(
&
mysql_connector
));
Logger
::
udr_mysql
().
info
(
"Connected to MySQL DB"
);
return
true
;
}
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
100
));
...
...
@@ -123,7 +123,8 @@ void mysql_db::start_event_connection_handling() {
//---------------------------------------------------------------------------------------------
void
mysql_db
::
trigger_connection_handling_procedure
(
uint64_t
ms
)
{
// _unused(ms);
Logger
::
udr_mysql
().
debug
(
"Trigger Connection Handling procedure %ld"
,
ms
);
Logger
::
udr_mysql
().
debug
(
"Connection Handling procedure (current time %ld)"
,
ms
);
if
(
mysql_ping
(
&
mysql_connector
))
{
Logger
::
udr_app
().
warn
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment