port-ocean 0.23.0__py3-none-any.whl → 0.23.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of port-ocean might be problematic. Click here for more details.

@@ -15,6 +15,7 @@ from port_ocean.context import resource
15
15
  from port_ocean.core.handlers.port_app_config.models import ResourceConfig
16
16
  from port_ocean.core.integrations.mixins import HandlerMixin, EventsMixin
17
17
  from port_ocean.core.integrations.mixins.utils import (
18
+ ProcessWrapper,
18
19
  is_resource_supported,
19
20
  unsupported_kind_response,
20
21
  resync_generator_wrapper,
@@ -613,11 +614,11 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
613
614
  "process_resource": FileIPC(id, "process_resource",([],[])),
614
615
  "topological_entities": FileIPC(id, "topological_entities",[]),
615
616
  }
616
- process = multiprocessing.Process(target=self.process_resource_in_subprocess, args=(file_ipc_map,resource,index,user_agent_type))
617
+ process = ProcessWrapper(target=self.process_resource_in_subprocess, args=(file_ipc_map,resource,index,user_agent_type))
617
618
  process.start()
618
- process.join()
619
- if process.exitcode != 0:
620
- logger.error(f"Process {id} failed with exit code {process.exitcode}")
619
+ await process.join_async()
620
+
621
+
621
622
  event.entity_topological_sorter.entities.extend(file_ipc_map["topological_entities"].load())
622
623
  return file_ipc_map["process_resource"].load()
623
624
 
@@ -3,6 +3,9 @@ from typing import Awaitable, Generator, Callable
3
3
 
4
4
  from loguru import logger
5
5
 
6
+ import asyncio
7
+ import multiprocessing
8
+
6
9
  from port_ocean.core.ocean_types import (
7
10
  ASYNC_GENERATOR_RESYNC_TYPE,
8
11
  RAW_RESULT,
@@ -72,3 +75,16 @@ def unsupported_kind_response(
72
75
  ) -> tuple[RESYNC_RESULT, list[Exception]]:
73
76
  logger.error(f"Kind {kind} is not supported in this integration")
74
77
  return [], [KindNotImplementedException(kind, available_resync_kinds)]
78
+
79
+ class ProcessWrapper(multiprocessing.Process):
80
+ def __init__(self, *args, **kwargs):
81
+ super().__init__(*args, **kwargs)
82
+
83
+ async def join_async(self) -> None:
84
+ while self.exitcode is None:
85
+ await asyncio.sleep(2)
86
+ if self.exitcode != 0:
87
+ logger.error(f"Process {self.pid} failed with exit code {self.exitcode}")
88
+ else:
89
+ logger.info(f"Process {self.pid} finished with exit code {self.exitcode}")
90
+ return super().join()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.23.0
3
+ Version: 0.23.1
4
4
  Summary: Port Ocean is a CLI tool for managing your Port projects.
5
5
  Home-page: https://app.getport.io
6
6
  Keywords: ocean,port-ocean,port
@@ -120,8 +120,8 @@ port_ocean/core/integrations/mixins/events.py,sha256=2L7P3Jhp8XBqddh2_o9Cn4N261n
120
120
  port_ocean/core/integrations/mixins/handler.py,sha256=mZ7-0UlG3LcrwJttFbMe-R4xcOU2H_g33tZar7PwTv8,3771
121
121
  port_ocean/core/integrations/mixins/live_events.py,sha256=8HklZmlyffYY_LeDe8xbt3Tb08rlLkqVhFF-2NQeJP4,4126
122
122
  port_ocean/core/integrations/mixins/sync.py,sha256=Vm_898pLKBwfVewtwouDWsXoxcOLicnAy6pzyqqk6U8,4053
123
- port_ocean/core/integrations/mixins/sync_raw.py,sha256=TCxWRyHu5p7Pn1qnl-crqFrf_CoOLEGo7wGs1XRS3ys,32284
124
- port_ocean/core/integrations/mixins/utils.py,sha256=_Pax41H3U75HZRPkrFbcSYdT4NDGb1LtdF_anuIcj1o,2347
123
+ port_ocean/core/integrations/mixins/sync_raw.py,sha256=XIVx_Y9TM8TCMzuoNowYGNtQG98n2pLTCFFHWbkIbTo,32176
124
+ port_ocean/core/integrations/mixins/utils.py,sha256=0rzzFnxrFNaVLHXShfDda5zjO8WwEUBW9oPWxnDsaXQ,2878
125
125
  port_ocean/core/models.py,sha256=MKfq69zGbFRzo0I2HRDUvSbz_pjrtcFVsD5B4Qwa3fw,2538
126
126
  port_ocean/core/ocean_types.py,sha256=4VipWFOHEh_d9LmWewQccwx1p2dtrRYW0YURVgNsAjo,1398
127
127
  port_ocean/core/utils/entity_topological_sorter.py,sha256=MDUjM6OuDy4Xj68o-7InNN0w1jqjxeDfeY8U02vySNI,3081
@@ -199,8 +199,8 @@ port_ocean/utils/repeat.py,sha256=U2OeCkHPWXmRTVoPV-VcJRlQhcYqPWI5NfmPlb1JIbc,32
199
199
  port_ocean/utils/signal.py,sha256=mMVq-1Ab5YpNiqN4PkiyTGlV_G0wkUDMMjTZp5z3pb0,1514
200
200
  port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
201
201
  port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
202
- port_ocean-0.23.0.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
203
- port_ocean-0.23.0.dist-info/METADATA,sha256=RAOhyPDxeKshLjPZ4hTM8uKjumyU2GZgpJDcjjNC-jY,6764
204
- port_ocean-0.23.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
205
- port_ocean-0.23.0.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
206
- port_ocean-0.23.0.dist-info/RECORD,,
202
+ port_ocean-0.23.1.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
203
+ port_ocean-0.23.1.dist-info/METADATA,sha256=0SgpycGus6heRD2nQPUfrIhkYMLSLPJ0PW2r8qxx3uA,6764
204
+ port_ocean-0.23.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
205
+ port_ocean-0.23.1.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
206
+ port_ocean-0.23.1.dist-info/RECORD,,