Skip to content

Commit

Permalink
[Core] Fix overriding of next resync status when cancelled due to sch…
Browse files Browse the repository at this point in the history
…eduled resync (#1035)
  • Loading branch information
Tankilevitch authored Sep 22, 2024
1 parent 339d284 commit 236ae72
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.10.12 (2024-09-19)

### Bug Fixes

- Fixed updating state of resync when the resync is being cancelled by a new resync event

## 0.10.11 (2024-09-17)

### Improvements
Expand Down
4 changes: 3 additions & 1 deletion port_ocean/core/integrations/mixins/sync_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ async def sync_raw_all(

creation_results.append(await task)
except asyncio.CancelledError as e:
logger.warning("Resync aborted successfully")
logger.warning("Resync aborted successfully, skipping delete phase. This leads to an incomplete state")
raise
else:
if not did_fetched_current_state:
logger.warning(
Expand Down Expand Up @@ -489,3 +490,4 @@ async def sync_raw_all(
{"before": entities_at_port, "after": flat_created_entities},
user_agent_type,
)
logger.info("Resync finished successfully")
4 changes: 4 additions & 0 deletions port_ocean/ocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ async def execute_resync_all() -> None:
try:
await self.integration.sync_raw_all()
await self.resync_state_updater.update_after_resync()
except asyncio.CancelledError:
logger.warning(
"resync was cancelled by the scheduled resync, skipping state update"
)
except Exception as e:
await self.resync_state_updater.update_after_resync(
IntegrationStateStatus.Failed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.10.11"
version = "0.10.12"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
Expand Down

0 comments on commit 236ae72

Please sign in to comment.