Skip to content

Commit

Permalink
Fix RAI default timeout
Browse files Browse the repository at this point in the history
As RAI request does not depend on any HMI response
there is no need to track any timeout for it. RAI
request will be removed from/ RequestController
queue upon RAI response which will be sent anyway
  • Loading branch information
AKalinich-Luxoft committed Aug 14, 2020
1 parent 7a433a3 commit c0eeb73
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,19 @@ class RegisterAppInterfaceRequest
/**
* @brief RegisterAppInterfaceRequest class destructor
**/
virtual ~RegisterAppInterfaceRequest();
~RegisterAppInterfaceRequest();

/**
* @brief Init required by command resources
**/
virtual bool Init();
bool Init() FINAL;

/**
* @brief Execute command
**/
virtual void Run();
void Run() FINAL;

uint32_t default_timeout() const FINAL;

private:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ bool RegisterAppInterfaceRequest::Init() {
return true;
}

uint32_t RegisterAppInterfaceRequest::default_timeout() const {
// As RAI request does not depend on any HMI response there is no need to
// track any timeout for it. RAI request will be removed from
// RequestController queue upon RAI response which will be sent anyway
return 0;
}

void RegisterAppInterfaceRequest::WaitForHMIIsReady() {
while (!application_manager_.IsStopping() &&
!application_manager_.IsHMICooperating()) {
Expand All @@ -208,8 +215,6 @@ void RegisterAppInterfaceRequest::WaitForHMIIsReady() {
<< ", correlation_id=" << correlation_id()
<< ", default_timeout=" << default_timeout()
<< ", thread=" << pthread_self());
application_manager_.updateRequestTimeout(
connection_key(), correlation_id(), default_timeout());
sleep(1);
// TODO(DK): timer_->StartWait(1);
}
Expand Down Expand Up @@ -767,9 +772,6 @@ void RegisterAppInterfaceRequest::Run() {
application_manager_.ApplyFunctorForEachPlugin(on_app_registered);

if (is_resumption_required) {
application_manager_.updateRequestTimeout(
connection_key(), correlation_id(), 0);

const auto& msg_params = (*message_)[strings::msg_params];
const auto& hash_id = msg_params[strings::hash_id].asString();
LOG4CXX_WARN(logger_, "Start Data Resumption");
Expand Down

0 comments on commit c0eeb73

Please sign in to comment.