port-ocean 0.9.3__py3-none-any.whl → 0.9.6__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.

@@ -71,7 +71,7 @@ async def _initialize_required_integration_settings(
71
71
  integration_config.event_listener.to_request(),
72
72
  port_app_config=default_mapping,
73
73
  )
74
- elif not integration["config"]:
74
+ elif not integration.get("config"):
75
75
  logger.info(
76
76
  "Encountered that the integration's mapping is empty, Initializing to default mapping"
77
77
  )
@@ -16,6 +16,7 @@ class PortAppConfigCache:
16
16
  _retrieval_time: float
17
17
 
18
18
  def __init__(self, cache_ttl: int):
19
+ self._port_app_config = None
19
20
  self._cache_ttl = cache_ttl
20
21
 
21
22
  @property
@@ -9,6 +9,7 @@ from loguru import logger
9
9
  from port_ocean.config.settings import LogLevelType
10
10
  from port_ocean.log.handlers import HTTPMemoryHandler
11
11
  from port_ocean.log.sensetive import sensitive_log_filter
12
+ from port_ocean.utils.signal import signal_handler
12
13
 
13
14
 
14
15
  def setup_logger(level: LogLevelType, enable_http_handler: bool) -> None:
@@ -53,7 +54,10 @@ def _http_loguru_handler(level: LogLevelType) -> None:
53
54
  )
54
55
  logger.configure(patcher=exception_deserializer)
55
56
 
56
- queue_listener = QueueListener(queue, HTTPMemoryHandler())
57
+ http_memory_handler = HTTPMemoryHandler()
58
+ signal_handler.register(http_memory_handler.flush)
59
+
60
+ queue_listener = QueueListener(queue, http_memory_handler)
57
61
  queue_listener.start()
58
62
 
59
63
 
port_ocean/ocean.py CHANGED
@@ -22,7 +22,7 @@ from port_ocean.core.integrations.base import BaseIntegration
22
22
  from port_ocean.log.sensetive import sensitive_log_filter
23
23
  from port_ocean.middlewares import request_handler
24
24
  from port_ocean.utils.repeat import repeat_every
25
- from port_ocean.utils.signal import signal_handler, init_signal_handler
25
+ from port_ocean.utils.signal import signal_handler
26
26
  from port_ocean.version import __integration_version__
27
27
 
28
28
 
@@ -97,14 +97,14 @@ class Ocean:
97
97
  @asynccontextmanager
98
98
  async def lifecycle(_: FastAPI) -> AsyncIterator[None]:
99
99
  try:
100
- init_signal_handler()
101
100
  await self.integration.start()
102
101
  await self._setup_scheduled_resync()
103
102
  yield None
104
- signal_handler.exit()
105
103
  except Exception:
106
104
  logger.exception("Integration had a fatal error. Shutting down.")
107
105
  sys.exit("Server stopped")
106
+ finally:
107
+ signal_handler.exit()
108
108
 
109
109
  self.fast_api_app.router.lifespan_context = lifecycle
110
110
  await self.fast_api_app(scope, receive, send)
port_ocean/run.py CHANGED
@@ -13,6 +13,7 @@ from port_ocean.core.utils import validate_integration_runtime
13
13
  from port_ocean.log.logger_setup import setup_logger
14
14
  from port_ocean.ocean import Ocean
15
15
  from port_ocean.utils.misc import get_spec_file, load_module
16
+ from port_ocean.utils.signal import init_signal_handler
16
17
 
17
18
 
18
19
  def _get_default_config_factory() -> None | Type[BaseModel]:
@@ -33,6 +34,7 @@ def run(
33
34
  ) -> None:
34
35
  application_settings = ApplicationSettings(log_level=log_level, port=port)
35
36
 
37
+ init_signal_handler()
36
38
  setup_logger(
37
39
  application_settings.log_level,
38
40
  enable_http_handler=application_settings.enable_http_logging,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.9.3
3
+ Version: 0.9.6
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
@@ -59,7 +59,7 @@ port_ocean/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
59
  port_ocean/core/defaults/__init__.py,sha256=8qCZg8n06WAdMu9s_FiRtDYLGPGHbOuS60vapeUoAks,142
60
60
  port_ocean/core/defaults/clean.py,sha256=S3UAfca-oU89WJKIB4OgGjGjPr0vxBQ2aRZsLTZhQ04,2185
61
61
  port_ocean/core/defaults/common.py,sha256=QnLFTkT3yIWIRtLQb7fUvvfe5AfInYJy0q5LjlzHkOw,3553
62
- port_ocean/core/defaults/initialize.py,sha256=FXaxDWHBQtRWUKAKNivrLYeV_YIXWHW8TjjMufXjp38,8861
62
+ port_ocean/core/defaults/initialize.py,sha256=DSY7kbSHQxs6-4ZAK3QYw-kVRsYq5txX7mUjkUB20Qw,8865
63
63
  port_ocean/core/event_listener/__init__.py,sha256=mzJ33wRq0kh60fpVdOHVmvMTUQIvz3vxmifyBgwDn0E,889
64
64
  port_ocean/core/event_listener/base.py,sha256=4RujgPz4VfDFlviu4qLGJFnJougSCL-Ewf0rfTQfwgc,1133
65
65
  port_ocean/core/event_listener/factory.py,sha256=AYYfSHPAF7P5H-uQECXT0JVJjKDHrYkWJJBSL4mGkg8,3697
@@ -80,7 +80,7 @@ port_ocean/core/handlers/entity_processor/base.py,sha256=udR0w5TstTOS5xOfTjAZIEd
80
80
  port_ocean/core/handlers/entity_processor/jq_entity_processor.py,sha256=_nQtlY0ZcCDf_Mpq4qcG7vVQ8LJS6DfkFMv-NHyFiJI,8421
81
81
  port_ocean/core/handlers/port_app_config/__init__.py,sha256=8AAT5OthiVM7KCcM34iEgEeXtn2pRMrT4Dze5r1Ixbk,134
82
82
  port_ocean/core/handlers/port_app_config/api.py,sha256=6VbKPwFzsWG0IYsVD81hxSmfqtHUFqrfUuj1DBX5g4w,853
83
- port_ocean/core/handlers/port_app_config/base.py,sha256=-n6b9oLjOA87YqxZv-r7paXxI8R86s44N_g56BEs56A,2970
83
+ port_ocean/core/handlers/port_app_config/base.py,sha256=4Nxt2g8voEIHJ4Y1Km5NJcaG2iSbCklw5P8-Kus7Y9k,3007
84
84
  port_ocean/core/handlers/port_app_config/models.py,sha256=4dw6HbgjMG3advpN3x6XF35xsgScnWm0KKTERG4CYZ8,2201
85
85
  port_ocean/core/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
86
  port_ocean/core/integrations/base.py,sha256=KHsRYFZ38ff3AkkqIQu45883ovgKOJn_fZfnTNy7HWY,2952
@@ -106,12 +106,12 @@ port_ocean/helpers/async_client.py,sha256=SRlP6o7_FCSY3UHnRlZdezppePVxxOzZ0z861v
106
106
  port_ocean/helpers/retry.py,sha256=hcfVmt2Fp53EQViYiOWA-FTWD80jvS-mWKhwMHiBM7Q,14869
107
107
  port_ocean/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
108
  port_ocean/log/handlers.py,sha256=k9G_Mb4ga2-Jke9irpdlYqj6EYiwv0gEsh4TgyqqOmI,2853
109
- port_ocean/log/logger_setup.py,sha256=NGU9EdRTPLloiHdgSw0JYaYGr9mx1hYJUEPFHP6BA14,2175
109
+ port_ocean/log/logger_setup.py,sha256=BaXt-mh9CVXhneh37H46d04lqOdIBixG1pFyGfotuZs,2328
110
110
  port_ocean/log/sensetive.py,sha256=wkyvkKMbyLTjZDSbvvLHL9bv4RvD0DPAyL3uWSttUOA,2916
111
111
  port_ocean/middlewares.py,sha256=6GrhldYAazxSwK2TbS-J28XdZ-9wO3PgCcyIMhnnJvI,2480
112
- port_ocean/ocean.py,sha256=nRTTh6faPrt77ozvKBFk6eCNxwzKcTDzJ4KPgpO4VRk,4304
112
+ port_ocean/ocean.py,sha256=6-hldutAbUF2Ka02bKAgtpwJ6MvlC6f44ARVWRXPqYc,4266
113
113
  port_ocean/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
114
- port_ocean/run.py,sha256=_5wwATpjQWQS19Dr8A-x8NOMslChMNc-So7sFqcZ74U,2130
114
+ port_ocean/run.py,sha256=rTxBlrQd4yyrtgErCFJCHCEHs7d1OXrRiJehUYmIbN0,2212
115
115
  port_ocean/sonar-project.properties,sha256=X_wLzDOkEVmpGLRMb2fg9Rb0DxWwUFSvESId8qpvrPI,73
116
116
  port_ocean/utils/__init__.py,sha256=KMGnCPXZJbNwtgxtyMycapkDz8tpSyw23MSYT3iVeHs,91
117
117
  port_ocean/utils/async_http.py,sha256=arnH458TExn2Dju_Sy6pHas_vF5RMWnOp-jBz5WAAcE,1226
@@ -122,8 +122,8 @@ port_ocean/utils/queue_utils.py,sha256=KWWl8YVnG-glcfIHhM6nefY-2sou_C6DVP1VynQwz
122
122
  port_ocean/utils/repeat.py,sha256=0EFWM9d8lLXAhZmAyczY20LAnijw6UbIECf5lpGbOas,3231
123
123
  port_ocean/utils/signal.py,sha256=K-6kKFQTltcmKDhtyZAcn0IMa3sUpOHGOAUdWKgx0_E,1369
124
124
  port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
125
- port_ocean-0.9.3.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
126
- port_ocean-0.9.3.dist-info/METADATA,sha256=YxXCvzQS5st0zZ_eK9xp-ZwWpfNnBlQbaFYIYOvqkNw,6561
127
- port_ocean-0.9.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
128
- port_ocean-0.9.3.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
129
- port_ocean-0.9.3.dist-info/RECORD,,
125
+ port_ocean-0.9.6.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
126
+ port_ocean-0.9.6.dist-info/METADATA,sha256=rSyZ_g4Z1j5B4a_c2p8gAegF7zhGu7sWctknyYoe-TI,6561
127
+ port_ocean-0.9.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
128
+ port_ocean-0.9.6.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
129
+ port_ocean-0.9.6.dist-info/RECORD,,