Mercurial > hg > nginx
comparison src/http/ngx_http_file_cache.c @ 3728:a29bb11f8c80
change logic slightly
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 02 Aug 2010 12:34:15 +0000 |
parents | fd2bb219de22 |
children | a47f431b27a6 |
comparison
equal
deleted
inserted
replaced
3727:fd2bb219de22 | 3728:a29bb11f8c80 |
---|---|
1005 } | 1005 } |
1006 | 1006 |
1007 ngx_memcpy(name, path->name.data, path->name.len); | 1007 ngx_memcpy(name, path->name.data, path->name.len); |
1008 | 1008 |
1009 wait = 10; | 1009 wait = 10; |
1010 tries = 0; | 1010 tries = 20; |
1011 | 1011 |
1012 ngx_shmtx_lock(&cache->shpool->mutex); | 1012 ngx_shmtx_lock(&cache->shpool->mutex); |
1013 | 1013 |
1014 for (q = ngx_queue_last(&cache->sh->queue); | 1014 for (q = ngx_queue_last(&cache->sh->queue); |
1015 q != ngx_queue_sentinel(&cache->sh->queue); | 1015 q != ngx_queue_sentinel(&cache->sh->queue); |
1024 | 1024 |
1025 if (fcn->count == 0) { | 1025 if (fcn->count == 0) { |
1026 ngx_http_file_cache_delete(cache, q, name); | 1026 ngx_http_file_cache_delete(cache, q, name); |
1027 | 1027 |
1028 } else { | 1028 } else { |
1029 if (tries++ < 20) { | 1029 if (--tries) { |
1030 continue; | 1030 continue; |
1031 } | 1031 } |
1032 | 1032 |
1033 wait = 1; | 1033 wait = 1; |
1034 } | 1034 } |