# HG changeset patch # User Maxim Dounin # Date 1398870995 -14400 # Node ID 5748ce74c1ccbe8c63d4fc6b91746bfa8bb86320 # Parent 0e1491139947c23f23fbed3b80e42ab5b12ccdf3 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(). diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c --- 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 for ( ;; ) { + if (ngx_quit || ngx_terminate) { + wait = 1; + break; + } + if (ngx_queue_empty(&cache->sh->queue)) { wait = 10; break;