Skip to content

Commit

Permalink
fix last checked time in nginx upstream module when up/down peer
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigzagAK committed Jan 6, 2017
1 parent ab5984e commit b04bb4c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ngx_dynamic_upstream_op.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,12 +804,16 @@ ngx_dynamic_upstream_http_op_update_param(ngx_log_t *log,

if (op->op_param & NGX_DYNAMIC_UPSTEAM_OP_PARAM_UP) {
target->down = 0;
target->checked = ngx_time();
target->fails = 0;
ngx_log_error(NGX_LOG_NOTICE, log, 0,
"downed server %V", &op->server);
}

if (op->op_param & NGX_DYNAMIC_UPSTEAM_OP_PARAM_DOWN) {
target->down = 1;
target->checked = ngx_time();
target->fails = target->max_fails;
ngx_log_error(NGX_LOG_NOTICE, log, 0,
"upped server %V", &op->server);
}
Expand Down Expand Up @@ -871,12 +875,16 @@ ngx_dynamic_upstream_stream_op_update_param(ngx_log_t *log,

if (op->op_param & NGX_DYNAMIC_UPSTEAM_OP_PARAM_UP) {
target->down = 0;
target->checked = ngx_time();
target->fails = 0;
ngx_log_error(NGX_LOG_NOTICE, log, 0,
"downed server %V", &op->server);
}

if (op->op_param & NGX_DYNAMIC_UPSTEAM_OP_PARAM_DOWN) {
target->down = 1;
target->checked = ngx_time();
target->fails = target->max_fails;
ngx_log_error(NGX_LOG_NOTICE, log, 0,
"upped server %V", &op->server);
}
Expand Down

0 comments on commit b04bb4c

Please sign in to comment.