Skip to content

Commit

Permalink
Merge pull request #881 from sphinx-contrib/skip-unchange-pages-cache…
Browse files Browse the repository at this point in the history
…-check-when-no-cleanup

builder: avoid unchanged page cache checks if we have legacy pages
  • Loading branch information
jdknight authored Feb 24, 2024
2 parents 679c3a3 + 37d36e6 commit df5a3d1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions sphinxcontrib/confluencebuilder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,14 +800,16 @@ def to_asset_name(asset):
except OSError as err:
self.warn(f'error reading asset {key}: {err}')

# if we have documents that were not changes (and therefore, not
# if we have documents that were not changed (and therefore, not
# needing to be republished), assume any cached publish page ids
# are still valid and remove them from the legacy pages list
other_docs = self.env.all_docs.keys() - set(self.publish_docnames)
for unchanged_doc in other_docs:
lpid = self._cache_info.last_page_id(unchanged_doc)
if lpid is not None and lpid in self.legacy_pages:
self.legacy_pages.remove(lpid)
if self.legacy_pages:
all_docnames = self.env.all_docs.keys()
other_docnames = all_docnames - set(self.publish_docnames)
for unchanged_docname in other_docnames:
lpid = self._cache_info.last_page_id(unchanged_docname)
if lpid is not None and lpid in self.legacy_pages:
self.legacy_pages.remove(lpid)

self.publish_cleanup()
self.publish_finalize()
Expand Down

0 comments on commit df5a3d1

Please sign in to comment.