Skip to content

Commit

Permalink
fix(add-ons): perform post-update with repository lock held
Browse files Browse the repository at this point in the history
It is typically updating the files so avoid possible concurrency with
other repository operations.

Fixes #12692
  • Loading branch information
nijel committed Oct 8, 2024
1 parent e26ff11 commit b264d2f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions weblate/addons/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,10 @@ def post_update(
self, component: Component, previous_head: str, skip_push: bool
) -> None:
# Ignore file parse error, it will be properly tracked as an alert
with suppress(FileParseError):
self.update_translations(component, previous_head)
self.commit_and_push(component, skip_push=skip_push)
with component.repository.lock:
with suppress(FileParseError):
self.update_translations(component, previous_head)
self.commit_and_push(component, skip_push=skip_push)


class StoreBaseAddon(BaseAddon):
Expand Down

0 comments on commit b264d2f

Please sign in to comment.