comparison src/http/ngx_http_file_cache.c @ 5679:5748ce74c1cc

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().
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 30 Apr 2014 19:16:35 +0400
parents 43ccaf8e8728
children 25ade23cf281
comparison
equal deleted inserted replaced
5678:0e1491139947 5679:5748ce74c1cc
1311 1311
1312 ngx_shmtx_lock(&cache->shpool->mutex); 1312 ngx_shmtx_lock(&cache->shpool->mutex);
1313 1313
1314 for ( ;; ) { 1314 for ( ;; ) {
1315 1315
1316 if (ngx_quit || ngx_terminate) {
1317 wait = 1;
1318 break;
1319 }
1320
1316 if (ngx_queue_empty(&cache->sh->queue)) { 1321 if (ngx_queue_empty(&cache->sh->queue)) {
1317 wait = 10; 1322 wait = 10;
1318 break; 1323 break;
1319 } 1324 }
1320 1325