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
b418d961
Commit
b418d961
authored
Apr 08, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
等待初始化完成增加超时,防止长时间等待
parent
da77d83b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
src/main.cpp
+9
-3
No files found.
src/main.cpp
View file @
b418d961
...
@@ -184,7 +184,7 @@ void* listen_pos_func(void* arg)
...
@@ -184,7 +184,7 @@ void* listen_pos_func(void* arg)
LOG
(
INFO
)
<<
"SEND END"
;
LOG
(
INFO
)
<<
"SEND END"
;
}
else
}
else
{
{
LOG
(
INFO
)
<<
"recv pos pushDat
e
failed"
;
LOG
(
INFO
)
<<
"recv pos pushDat
a
failed"
;
}
}
}
else
}
else
{
{
...
@@ -246,7 +246,7 @@ int main()
...
@@ -246,7 +246,7 @@ int main()
/// 注册回调函数
/// 注册回调函数
el
::
Helpers
::
installPreRollOutCallback
(
logRolloutHandler
);
el
::
Helpers
::
installPreRollOutCallback
(
logRolloutHandler
);
LOG
(
INFO
)
<<
"---------software start---------"
;
LOG
(
INFO
)
<<
"---------software start---------
.
"
;
//sqlite初始化
//sqlite初始化
// if(!sqlite.initSQLite()){
// if(!sqlite.initSQLite()){
...
@@ -313,14 +313,20 @@ int main()
...
@@ -313,14 +313,20 @@ int main()
ods
.
receive
(
odsPushData
);
ods
.
receive
(
odsPushData
);
g_init_data_ods_back
=
odsPushData
;
g_init_data_ods_back
=
odsPushData
;
LOG
(
INFO
)
<<
"INIT ODS ===>> PLUGIN:"
<<
odsPushData
.
data
();
LOG
(
INFO
)
<<
"INIT ODS ===>> PLUGIN:"
<<
odsPushData
.
data
();
int
count
=
0
;
while
(
!
bInitDone
){
while
(
!
bInitDone
){
LOG
(
INFO
)
<<
"wait for init done"
;
LOG
(
INFO
)
<<
"wait for init done"
;
if
(
!
ods
.
isValid
()
){
if
(
!
ods
.
isValid
()
){
LOG
(
INFO
)
<<
"ods is not valid"
;
LOG
(
INFO
)
<<
"ods is not valid"
;
sleep
(
1
);
break
;
break
;
}
}
sleep
(
1
);
sleep
(
1
);
count
++
;
//如果10s没有初始化完成,则跳出循环,重新连接
if
(
10
==
count
){
ods
.
close
();
break
;
}
}
}
break
;
break
;
...
...
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