aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-04-30 19:16:35 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2014-04-30 19:16:35 +0400
commit17dad56e4ed2e6db5d3b2559a355a0819f72e501 (patch)
tree5a29025cf96565500a19fa2a1167643647e6cce0 /src
parent1efe4fa7f770838dd389586c2b41c223c7c63cc7 (diff)
downloadnginx-17dad56e4ed2e6db5d3b2559a355a0819f72e501.tar.gz
nginx-17dad56e4ed2e6db5d3b2559a355a0819f72e501.zip
Cache: added ngx_quit check to ngx_http_file_cache_expire().
While managing big caches it is possible that expiring old cache items in ngx_http_file_cache_expire() will take a while. Added a check for ngx_quit / ngx_terminate to make sure cache manager can be terminated while in ngx_http_file_cache_expire().
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_file_cache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c
index 9e6be1584..49abdb400 100644
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -1313,6 +1313,11 @@ ngx_http_file_cache_expire(ngx_http_file_cache_t *cache)
for ( ;; ) {
+ if (ngx_quit || ngx_terminate) {
+ wait = 1;
+ break;
+ }
+
if (ngx_queue_empty(&cache->sh->queue)) {
wait = 10;
break;