From 4db063335fc09c710df761fe5881e819f210c482 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Wed, 16 Sep 2020 14:38:58 +0800 Subject: [PATCH] set last_report_time correctly --- src/idempotency/client/client_channel.c | 2 +- src/idempotency/client/receipt_handler.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/idempotency/client/client_channel.c b/src/idempotency/client/client_channel.c index a398b86..a93f0b1 100644 --- a/src/idempotency/client/client_channel.c +++ b/src/idempotency/client/client_channel.c @@ -65,7 +65,7 @@ static int load_client_channel_config(IniFullContext *ini_ctx) g_idempotency_client_cfg.channel_max_idle_time = iniGetIntValue( ini_ctx->section_name, "channel_max_idle_time", - ini_ctx->context, 3); + ini_ctx->context, 300); return 0; } diff --git a/src/idempotency/client/receipt_handler.c b/src/idempotency/client/receipt_handler.c index 69a4300..746ae9e 100644 --- a/src/idempotency/client/receipt_handler.c +++ b/src/idempotency/client/receipt_handler.c @@ -51,10 +51,13 @@ static int receipt_recv_timeout_callback(struct fast_task_info *task) logError("file: "__FILE__", line: %d, " "waiting receipt response from server %s:%d timeout", __LINE__, task->server_ip, task->port); - return ETIMEDOUT; + } else { + logError("file: "__FILE__", line: %d, " + "communication with server %s:%d timeout", + __LINE__, task->server_ip, task->port); } - return 0; + return ETIMEDOUT; } static void receipt_task_finish_cleanup(struct fast_task_info *task) @@ -214,10 +217,12 @@ static int report_req_receipt_request(struct fast_task_info *task, if (count == 0) { result = sf_set_read_event(task); - } else if (update_lru) { + } else { ((IdempotencyClientChannel *)task->arg)-> last_report_time = g_current_time; - update_lru_chain(task); + if (update_lru) { + update_lru_chain(task); + } } return 0;