summaryrefslogtreecommitdiffabout
path: root/cgit.c
Side-by-side diff
Diffstat (limited to 'cgit.c') (more/less context) (show whitespace changes)
-rw-r--r--cgit.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index d1abaa0..0f72f2d 100644
--- a/cgit.c
+++ b/cgit.c
@@ -62,11 +62,17 @@ static void cgit_check_cache(struct cacheitem *item)
goto top;
}
- if (!cache_exist(item))
+ if (!cache_exist(item)) {
cgit_fill_cache(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);
+ } else {
+ cache_cancel_lock(item);
+ }
}
}