Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
familyMart_takeaway
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guanghui.cui
familyMart_takeaway
Commits
e160fdd7
Commit
e160fdd7
authored
Jul 09, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
连接ods失败后,增加延时时间
parent
27d8b327
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/main.cpp
+5
-4
No files found.
src/main.cpp
View file @
e160fdd7
...
...
@@ -18,7 +18,7 @@
INITIALIZE_EASYLOGGINGPP
#define VERSION "1.0.
5 Beta4
" //版本号
#define VERSION "1.0.
6
" //版本号
std
::
string
g_init_data
;
std
::
string
g_init_data_ods_back
;
...
...
@@ -324,6 +324,7 @@ int main(int argc,char *argv[])
if
(
odsPushData
.
empty
()
||
!
jsonTool
.
isInitBackValid
(
odsPushData
.
data
()))
{
LOG
(
INFO
)
<<
"invalid data,close connect"
;
ods
.
close
();
//当连接到负载均衡,并没有和ods建立连接的时候。返回值为空,所以应该关闭重新连接
os_sleep
(
10
);
}
int
count
=
0
;
while
(
!
bInitDone
){
...
...
@@ -333,7 +334,7 @@ int main(int argc,char *argv[])
os_sleep
(
1
);
//防止在ods挂掉后狂刷日志
break
;
}
os_sleep
(
1
);
os_sleep
(
2
);
count
++
;
//如果10s没有初始化完成,则跳出循环,重新连接
if
(
10
==
count
){
...
...
@@ -347,13 +348,13 @@ int main(int argc,char *argv[])
else
{
LOG
(
INFO
)
<<
"Haven't receive init data"
;
}
os_sleep
(
3
);
os_sleep
(
10
);
continue
;
}
}
else
{
LOG
(
INFO
)
<<
"connect ODS failed"
;
os_sleep
(
5
);
os_sleep
(
10
);
continue
;
}
}
...
...
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