Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Keep a scan with a negative ttl for good
"The cache" promises that a negative ttl never expires, but no age was
ever below a negative cache-scan-ttl, so every request started a
background rescan.
Diffstat (limited to 'source/cgit.c')
| -rw-r--r-- | source/cgit.c | 3 |
1 file changed, 2 insertions, 1 deletion
diff --git a/source/cgit.c b/source/cgit.c index 254062f..41bbad3 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -452,8 +452,9 @@ static void process_cached_repolist(const char *path) config_file_parse(cached_rc.buf, apply_config); + // A negative ttl never expires, the same as for a cached page. age = time(NULL) - st.st_mtime; - if (age <= (ctx.cfg.cache_scan_ttl * 60)) + if (ctx.cfg.cache_scan_ttl < 0 || age <= (ctx.cfg.cache_scan_ttl * 60)) goto out; // The list just parsed is stale but usable, so a child rebuilds it |
