Skip to content

Commit

Permalink
If you can't beat em, join em
Browse files Browse the repository at this point in the history
  • Loading branch information
darrylmasson committed Oct 22, 2020
1 parent 7188619 commit 4879bbc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,14 @@ int main(int argc, char** argv){
fOptions = std::make_shared<Options>(fLog, mode,
hostname, suri, dbname, override_json);
int dt = duration_cast<milliseconds>(system_clock::now()-ack_time).count();
if (dt > 3000){
fLog->Entry(MongoLog::Warning,
"Took too long to pull the config docs, try again");
continue;
} else {
if (dt < 15000) std::this_thread::sleep_for(milliseconds(15000-dt));
//if (dt > 3000){
// fLog->Entry(MongoLog::Warning,
// "Took too long to pull the config docs, try again");
// continue;
//} else {
fLog->Entry(MongoLog::Local, "Took %i ms to load config", dt);
}
//}
if(controller->Arm(fOptions) != 0){
fLog->Entry(MongoLog::Error, "Failed to initialize electronics");
controller->Stop();
Expand Down

0 comments on commit 4879bbc

Please sign in to comment.