]> git.kaiwu.me - nginx.git/commitdiff
Cache: added ngx_quit check to ngx_http_file_cache_expire().
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 30 Apr 2014 15:16:35 +0000 (19:16 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 30 Apr 2014 15:16:35 +0000 (19:16 +0400)
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().

src/http/ngx_http_file_cache.c

index 9e6be15844a2d9aeebb361400a5bd3686709bd0b..49abdb400d6c6f488269be388e0b00178f59db92 100644 (file)
@@ -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;