diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-15 14:14:32 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-15 14:14:45 +0200 |
| commit | 00e5de525bde5d0d77d9553c6126908f2fdfde20 (patch) | |
| tree | 0686bc72be5f7a5bc5fd18f5dcdd6d0cfb868ac3 /lib/atomfeed.source.sh | |
| parent | e6aa888599062843409d037b4007be43ef3b0f02 (diff) | |
Improve --generate performance with incremental builds (62s -> 2s)
Add mtime-based skip logic to avoid regenerating unchanged files:
- generate::fromgmi skips .gmi files where all outputs are newer
- template::_generate_file skips templates when output is fresh
- Diff-before-overwrite in templates, gemfeed, and notes indexes
to preserve mtimes and prevent cascading cache invalidation
- Global dependency check (.lastgen sentinel) for header/footer/CSS
- Job throttling via wait -n capped at nproc cores
- Add --force flag and FORCE_REBUILD env var to bypass skip logic
- Fix misleading atom feed "empty cache" log message
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'lib/atomfeed.source.sh')
| -rw-r--r-- | lib/atomfeed.source.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/atomfeed.source.sh b/lib/atomfeed.source.sh index 4b598a7..3fe46be 100644 --- a/lib/atomfeed.source.sh +++ b/lib/atomfeed.source.sh @@ -61,7 +61,11 @@ atomfeed::generate () { local -r atom_file="$gemfeed_dir/atom.xml" log INFO "Generating Atom feed to $atom_file" - log INFO 'This may takes a while with an empty cache....' + + # Only warn about slow generation when the cache is actually empty + if [ ! -d "$CONTENT_BASE_DIR/cache" ] || [ -z "$(ls "$CONTENT_BASE_DIR/cache/gemfeed/" 2>/dev/null)" ]; then + log INFO 'This may take a while with an empty cache....' + fi cat <<ATOMHEADER > "$atom_file.tmp" <?xml version="1.0" encoding="utf-8"?> |
