port-ocean 0.9.5__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.
- port_ocean/log/logger_setup.py +5 -1
- port_ocean/ocean.py +3 -3
- port_ocean/run.py +2 -0
- {port_ocean-0.9.5.dist-info → port_ocean-0.9.6.dist-info}/METADATA +1 -1
- {port_ocean-0.9.5.dist-info → port_ocean-0.9.6.dist-info}/RECORD +8 -8
- {port_ocean-0.9.5.dist-info → port_ocean-0.9.6.dist-info}/LICENSE.md +0 -0
- {port_ocean-0.9.5.dist-info → port_ocean-0.9.6.dist-info}/WHEEL +0 -0
- {port_ocean-0.9.5.dist-info → port_ocean-0.9.6.dist-info}/entry_points.txt +0 -0
port_ocean/log/logger_setup.py
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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,
|
|
@@ -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=
|
|
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=
|
|
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=
|
|
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.
|
|
126
|
-
port_ocean-0.9.
|
|
127
|
-
port_ocean-0.9.
|
|
128
|
-
port_ocean-0.9.
|
|
129
|
-
port_ocean-0.9.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|