Commit 9e55e7e4 authored by Kishen Maloor's avatar Kishen Maloor

Merge branch 'gaborone' into gaborone+

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parents a268abe9 4bcd6845
Pipeline #1159 passed with stage
in 6 minutes and 5 seconds
......@@ -115,6 +115,7 @@ static void
cloud_start_process(oc_cloud_context_t *ctx)
{
ctx->retry_count = 0;
ctx->retry_refresh_token_count = 0;
if (ctx->store.status == OC_CLOUD_INITIALIZED) {
oc_set_delayed_callback(ctx, cloud_register, session_timeout[0]);
......@@ -497,7 +498,7 @@ refresh_token(void *data)
if (cannotConnect) {
cloud_set_last_error(ctx, CLOUD_ERROR_REFRESH_ACCESS_TOKEN);
}
oc_set_delayed_callback(ctx, cloud_login,
oc_set_delayed_callback(ctx, refresh_token,
session_timeout[ctx->retry_refresh_token_count]);
}
......
......@@ -251,6 +251,10 @@ void
cloud_rd_manager_status_changed(oc_cloud_context_t *ctx)
{
if (ctx->store.status & OC_CLOUD_LOGGED_IN) {
if (ctx->store.status & OC_CLOUD_REFRESHED_TOKEN) {
// when refresh occurs we don't want to publish resources.
return;
}
publish_published_resources(ctx);
delete_resources(ctx, false);
oc_remove_delayed_callback(ctx, publish_published_resources);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment