在线联调通过。修正force caching的优先级判断。
This commit is contained in:
@@ -1221,6 +1221,7 @@ static void wrap_cache_write_on_fail(enum e_future_error err, const char * what,
|
|||||||
struct cache_write_future_ctx* ctx=(struct cache_write_future_ctx*)user;
|
struct cache_write_future_ctx* ctx=(struct cache_write_future_ctx*)user;
|
||||||
TFE_LOG_DEBUG(ctx->ref_handle->logger, "cache upload failed: %s %s lapse: %d", ctx->url, what, time(NULL)-ctx->start);
|
TFE_LOG_DEBUG(ctx->ref_handle->logger, "cache upload failed: %s %s lapse: %d", ctx->url, what, time(NULL)-ctx->start);
|
||||||
cache_write_future_ctx_free(ctx);
|
cache_write_future_ctx_free(ctx);
|
||||||
|
ATOMIC_INC(&(ctx->ref_handle->stat_val[STAT_CACHE_WRITE_ERR]));
|
||||||
}
|
}
|
||||||
|
|
||||||
struct cache_write_context* web_cache_write_start(struct cache_handle* handle, unsigned int thread_id,
|
struct cache_write_context* web_cache_write_start(struct cache_handle* handle, unsigned int thread_id,
|
||||||
@@ -1268,11 +1269,16 @@ struct cache_write_context* web_cache_write_start(struct cache_handle* handle, u
|
|||||||
case REVALIDATE:
|
case REVALIDATE:
|
||||||
case ALLOWED:
|
case ALLOWED:
|
||||||
case UNDEFINED:
|
case UNDEFINED:
|
||||||
if(_mid->shall_bypass
|
if(param->force_caching)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if(_mid->shall_bypass
|
||||||
|| (param->max_cache_obj_size!=0 && content_len > param->max_cache_obj_size)
|
|| (param->max_cache_obj_size!=0 && content_len > param->max_cache_obj_size)
|
||||||
|| (param->min_cache_obj_size > content_len)
|
|| (param->min_cache_obj_size > content_len)
|
||||||
|| (!param->cache_cookied_cont && _mid->has_cookie)
|
|| (!param->cache_cookied_cont && _mid->has_cookie)
|
||||||
|| (!param->cache_html && _mid->is_html))
|
|| (!param->cache_html && _mid->is_html)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
ATOMIC_INC(&(handle->stat_val[STAT_CACHE_WRITE_BYPASS]));
|
ATOMIC_INC(&(handle->stat_val[STAT_CACHE_WRITE_BYPASS]));
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1376,9 +1382,10 @@ void web_cache_write_end(struct cache_write_context* ctx)
|
|||||||
if(ret<0)
|
if(ret<0)
|
||||||
{
|
{
|
||||||
//upload too slow or storage server error;
|
//upload too slow or storage server error;
|
||||||
cache_write_future_ctx_free(future_ctx);
|
|
||||||
TFE_LOG_DEBUG(ctx->ref_cache_handle->logger, "cache upload failed: %s",ctx->future_ctx->url);
|
TFE_LOG_DEBUG(ctx->ref_cache_handle->logger, "cache upload failed: %s",ctx->future_ctx->url);
|
||||||
return;
|
cache_write_future_ctx_free(ctx->future_ctx);
|
||||||
|
ctx->future_ctx=NULL;
|
||||||
|
ATOMIC_INC(&(ctx->ref_cache_handle->stat_val[STAT_CACHE_WRITE_ERR]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user