Skip to content

Commit 0dff978

Browse files
committed
env: maintain tracked page identifier cache between builds
When a cache is kept for tracking previously published pages and their identifiers, if a processing event results in pages not needing to be updated, unchanged pages can cause their page identifiers to be removed from the active list. This can result in a following pass to cleanup legacy-flagged pages for pages that are still considered unchanged. The cache implementation should be maintaining the assumed cached identifier for pages if they remain changed for a run. Updating the implementation to always populate the cached page identifiers before replacing them with new active page identifiers (if any). Signed-off-by: James Knight <git@jdknight.me>
1 parent 568064a commit 0dff978

File tree

1 file changed

+4
-1
lines changed
  • sphinxcontrib/confluencebuilder

1 file changed

+4
-1
lines changed

sphinxcontrib/confluencebuilder/env.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ def save_cache(self):
210210
new_dochashs = dict(self._cached_dochash)
211211
new_dochashs.update(self._active_dochash)
212212

213+
new_pids = dict(self._cached_pids)
214+
new_pids.update(self._active_pids)
215+
213216
try:
214217
with self._cache_cfg_file.open('w', encoding='utf-8') as f:
215218
json.dump(new_cfg, f)
@@ -224,6 +227,6 @@ def save_cache(self):
224227

225228
try:
226229
with self._cache_publish_file.open('w', encoding='utf-8') as f:
227-
json.dump(self._active_pids, f)
230+
json.dump(new_pids, f)
228231
except OSError as e:
229232
self.builder.warn('failed to save cache (pids): ' + e)

0 commit comments

Comments
 (0)