diff options
author | Alexander Kutsan <alexkutsan@ya.ru> | 2017-01-16 21:22:17 +0200 |
---|---|---|
committer | Alexander Kutsan <alexkutsan@ya.ru> | 2017-01-16 21:28:55 +0200 |
commit | ab5542c22979e4fe2ce86db2d0c7bd4cca949cff (patch) | |
tree | 2f54ded2167ca20627017978b5499dfec67e3995 /src/components | |
parent | 787736fe317125e77d9a422c86169c17e1d3a678 (diff) | |
download | sdl_core-ab5542c22979e4fe2ce86db2d0c7bd4cca949cff.tar.gz |
Avoid using miliseconds for retry sequence timeout
Related issue : APPLINK-31433
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/application_manager/src/policies/policy_handler.cc | 2 | ||||
-rw-r--r-- | src/components/policy/policy_regular/src/policy_manager_impl.cc | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 513afb9a43..2f87856e12 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1352,7 +1352,7 @@ void PolicyHandler::OnSnapshotCreated(const BinaryMessage& pt_string) { return; } MessageHelper::SendPolicyUpdate(policy_snapshot_full_path, - policy_manager_->TimeoutExchangeMSec(), + TimeoutExchangeSec(), policy_manager_->RetrySequenceDelaysSeconds(), application_manager_); #else // PROPRIETARY_MODE diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index ac82c9ebcb..65a7c42f90 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -58,7 +58,8 @@ void DeleteManager(policy::PolicyManager* pm) { } namespace { -const uint32_t kDefaultRetryTimeoutInMSec = 60u * date_time::DateTime::MILLISECONDS_IN_SECOND; +const uint32_t kDefaultRetryTimeoutInMSec = + 60u * date_time::DateTime::MILLISECONDS_IN_SECOND; } // namespace namespace policy { @@ -311,7 +312,9 @@ void PolicyManagerImpl::StartPTExchange() { if (update_status_manager_.IsUpdateRequired()) { if (RequestPTUpdate() && !timer_retry_sequence_.is_running()) { // Start retry sequency - timer_retry_sequence_.Start(NextRetryTimeout(), timer::kPeriodic); + const int t = NextRetryTimeout(); + LOG4CXX_DEBUG(logger_, "Start retry sequence timeout = " << t); + timer_retry_sequence_.Start(t, timer::kPeriodic); } } } @@ -780,7 +783,7 @@ uint32_t PolicyManagerImpl::NextRetryTimeout() { } // Return miliseconds - return next * date_time::DateTime::MILLISECONDS_IN_SECOND; + return next; } void PolicyManagerImpl::RefreshRetrySequence() { @@ -1005,10 +1008,11 @@ void PolicyManagerImpl::RetrySequence() { uint32_t timeout = NextRetryTimeout(); if (!timeout && timer_retry_sequence_.is_running()) { + LOG4CXX_DEBUG(logger_, "AKutsan Stop timer " << timeout); timer_retry_sequence_.Stop(); return; } - + LOG4CXX_DEBUG(logger_, "AKutsan start " << timeout); timer_retry_sequence_.Start(timeout, timer::kPeriodic); } |