Mercurial > hg > nginx
comparison src/http/ngx_http_file_cache.c @ 3972:c1a69e03bdf2
rename ngx_http_file_cache_manager_sleep() to ngx_http_file_cache_loader_sleep()
and do not use it all in cache manager: this is a vestige of the times when
cache manager loaded cache
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 25 Jul 2011 09:45:00 +0000 |
parents | 44f4fc874b2f |
children | 9d6f21415231 |
comparison
equal
deleted
inserted
replaced
3971:44f4fc874b2f | 3972:c1a69e03bdf2 |
---|---|
29 static time_t ngx_http_file_cache_forced_expire(ngx_http_file_cache_t *cache); | 29 static time_t ngx_http_file_cache_forced_expire(ngx_http_file_cache_t *cache); |
30 static time_t ngx_http_file_cache_expire(ngx_http_file_cache_t *cache); | 30 static time_t ngx_http_file_cache_expire(ngx_http_file_cache_t *cache); |
31 static void ngx_http_file_cache_delete(ngx_http_file_cache_t *cache, | 31 static void ngx_http_file_cache_delete(ngx_http_file_cache_t *cache, |
32 ngx_queue_t *q, u_char *name); | 32 ngx_queue_t *q, u_char *name); |
33 static ngx_int_t | 33 static ngx_int_t |
34 ngx_http_file_cache_manager_sleep(ngx_http_file_cache_t *cache); | 34 ngx_http_file_cache_loader_sleep(ngx_http_file_cache_t *cache); |
35 static ngx_int_t ngx_http_file_cache_noop(ngx_tree_ctx_t *ctx, | 35 static ngx_int_t ngx_http_file_cache_noop(ngx_tree_ctx_t *ctx, |
36 ngx_str_t *path); | 36 ngx_str_t *path); |
37 static ngx_int_t ngx_http_file_cache_manage_file(ngx_tree_ctx_t *ctx, | 37 static ngx_int_t ngx_http_file_cache_manage_file(ngx_tree_ctx_t *ctx, |
38 ngx_str_t *path); | 38 ngx_str_t *path); |
39 static ngx_int_t ngx_http_file_cache_add_file(ngx_tree_ctx_t *ctx, | 39 static ngx_int_t ngx_http_file_cache_add_file(ngx_tree_ctx_t *ctx, |
1205 | 1205 |
1206 if (wait > 0) { | 1206 if (wait > 0) { |
1207 return wait; | 1207 return wait; |
1208 } | 1208 } |
1209 | 1209 |
1210 if (ngx_http_file_cache_manager_sleep(cache) != NGX_OK) { | 1210 if (ngx_quit || ngx_terminate) { |
1211 return next; | 1211 return next; |
1212 } | 1212 } |
1213 } | 1213 } |
1214 } | 1214 } |
1215 | 1215 |
1259 cache->bsize); | 1259 cache->bsize); |
1260 } | 1260 } |
1261 | 1261 |
1262 | 1262 |
1263 static ngx_int_t | 1263 static ngx_int_t |
1264 ngx_http_file_cache_manager_sleep(ngx_http_file_cache_t *cache) | 1264 ngx_http_file_cache_loader_sleep(ngx_http_file_cache_t *cache) |
1265 { | 1265 { |
1266 ngx_msec_t elapsed; | 1266 ngx_msec_t elapsed; |
1267 | 1267 |
1268 if (cache->files++ > 100) { | 1268 if (cache->files++ > 100) { |
1269 | 1269 |
1311 | 1311 |
1312 if (ngx_http_file_cache_add_file(ctx, path) != NGX_OK) { | 1312 if (ngx_http_file_cache_add_file(ctx, path) != NGX_OK) { |
1313 (void) ngx_http_file_cache_delete_file(ctx, path); | 1313 (void) ngx_http_file_cache_delete_file(ctx, path); |
1314 } | 1314 } |
1315 | 1315 |
1316 return ngx_http_file_cache_manager_sleep(cache); | 1316 return ngx_http_file_cache_loader_sleep(cache); |
1317 } | 1317 } |
1318 | 1318 |
1319 | 1319 |
1320 static ngx_int_t | 1320 static ngx_int_t |
1321 ngx_http_file_cache_add_file(ngx_tree_ctx_t *ctx, ngx_str_t *name) | 1321 ngx_http_file_cache_add_file(ngx_tree_ctx_t *ctx, ngx_str_t *name) |