Skip to content

Commit

Permalink
Merge pull request #1082 from sphinx-contrib/internal-delay-all-cloud…
Browse files Browse the repository at this point in the history
…-prop-events

internal delay all cloud property update events
  • Loading branch information
jdknight authored Feb 1, 2025
2 parents 78a2603 + d29b0ca commit cab1d10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions sphinxcontrib/confluencebuilder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ def setup(app):
cm.add_conf_bool('confluence_adv_bulk_archiving')
# Force override for detected Cloud state.
cm.add_conf_bool('confluence_adv_cloud')
# Disable any delays when publishing property updates on Cloud
cm.add_conf_bool('confluence_adv_disable_cloud_prop_delay')
# Disable workaround for: https://jira.atlassian.com/browse/CONFCLOUD-74698
cm.add_conf_bool('confluence_adv_disable_confcloud_74698')
# Disable workaround for inline-extension anchor injection
Expand Down
15 changes: 8 additions & 7 deletions sphinxcontrib/confluencebuilder/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,13 +1112,6 @@ def store_page(self, page_name, data, parent_id=None):

uploaded_page_id = rsp['id']

# always wait a little moment before updating properies on
# cloud -- it seems to take a moment to complete creating
# initial properties after we build a new page, and we want
# to avoid a conflict (409) if possible
if self.cloud:
time.sleep(0.5)

# we have properties we would like to apply, but we cannot
# just create new ones if Confluence already created ones
# implicitly in the new page update -- we will need to
Expand Down Expand Up @@ -1243,6 +1236,14 @@ def _update_page_properties(self, page_id, properties):
properties: the properties to update
"""

# always wait a little moment before updating properties on
# cloud -- it seems to take a moment to complete creating or
# updating properties after we build process a page, and we want
# to avoid a conflict (409) if possible
if self.cloud:
if not self.config.confluence_adv_disable_cloud_prop_delay:
time.sleep(0.5)

# we have properties we would like to apply, but we cannot
# just create new ones if Confluence already created ones
# implicitly in the new page update -- we will need to
Expand Down

0 comments on commit cab1d10

Please sign in to comment.