X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/44923f8953c66dc9b852316b655ab3b5aec9478e..fbaf1171b4e343929dd43ecac7cd9d1c692b84ec:/cgit.c?ds=inline diff --git a/cgit.c b/cgit.c index d1abaa0..0f72f2d 100644 --- a/cgit.c +++ b/cgit.c @@ -61,13 +61,19 @@ static void cgit_check_cache(struct cacheitem *item) sleep(1); goto top; } - if (!cache_exist(item)) + if (!cache_exist(item)) { cgit_fill_cache(item); - cache_unlock(item); + cache_unlock(item); + } else { + cache_cancel_lock(item); + } } else if (cache_expired(item) && cache_lock(item)) { - if (cache_expired(item)) + if (cache_expired(item)) { cgit_fill_cache(item); - cache_unlock(item); + cache_unlock(item); + } else { + cache_cancel_lock(item); + } } }