port-ocean 0.12.9__py3-none-any.whl → 0.12.9.dev1__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/ocean.py +16 -18
- {port_ocean-0.12.9.dist-info → port_ocean-0.12.9.dev1.dist-info}/METADATA +1 -1
- {port_ocean-0.12.9.dist-info → port_ocean-0.12.9.dev1.dist-info}/RECORD +6 -6
- {port_ocean-0.12.9.dist-info → port_ocean-0.12.9.dev1.dist-info}/LICENSE.md +0 -0
- {port_ocean-0.12.9.dist-info → port_ocean-0.12.9.dev1.dist-info}/WHEEL +0 -0
- {port_ocean-0.12.9.dist-info → port_ocean-0.12.9.dev1.dist-info}/entry_points.txt +0 -0
port_ocean/ocean.py
CHANGED
|
@@ -39,8 +39,22 @@ class Ocean:
|
|
|
39
39
|
config_override: Dict[str, Any] | None = None,
|
|
40
40
|
):
|
|
41
41
|
initialize_port_ocean_context(self)
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
|
|
43
|
+
@asynccontextmanager
|
|
44
|
+
async def lifespan(_: FastAPI) -> AsyncIterator[None]:
|
|
45
|
+
try:
|
|
46
|
+
await self.integration.start()
|
|
47
|
+
await self._setup_scheduled_resync()
|
|
48
|
+
yield None
|
|
49
|
+
except Exception:
|
|
50
|
+
logger.exception("Integration had a fatal error. Shutting down.")
|
|
51
|
+
logger.complete()
|
|
52
|
+
sys.exit("Server stopped")
|
|
53
|
+
finally:
|
|
54
|
+
signal_handler.exit()
|
|
55
|
+
|
|
56
|
+
self.fast_api_app = app or FastAPI(lifespan=lifespan)
|
|
57
|
+
# self.fast_api_app.middleware("http")(request_handler)
|
|
44
58
|
|
|
45
59
|
self.config = IntegrationConfiguration(
|
|
46
60
|
# type: ignore
|
|
@@ -113,20 +127,4 @@ class Ocean:
|
|
|
113
127
|
await repeated_function()
|
|
114
128
|
|
|
115
129
|
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
|
|
116
|
-
self.fast_api_app.include_router(self.integration_router, prefix="/integration")
|
|
117
|
-
|
|
118
|
-
@asynccontextmanager
|
|
119
|
-
async def lifecycle(_: FastAPI) -> AsyncIterator[None]:
|
|
120
|
-
try:
|
|
121
|
-
await self.integration.start()
|
|
122
|
-
await self._setup_scheduled_resync()
|
|
123
|
-
yield None
|
|
124
|
-
except Exception:
|
|
125
|
-
logger.exception("Integration had a fatal error. Shutting down.")
|
|
126
|
-
logger.complete()
|
|
127
|
-
sys.exit("Server stopped")
|
|
128
|
-
finally:
|
|
129
|
-
signal_handler.exit()
|
|
130
|
-
|
|
131
|
-
self.fast_api_app.router.lifespan_context = lifecycle
|
|
132
130
|
await self.fast_api_app(scope, receive, send)
|
|
@@ -115,7 +115,7 @@ port_ocean/log/handlers.py,sha256=ncVjgqrZRh6BhyRrA6DQG86Wsbxph1yWYuEC0cWfe-Q,36
|
|
|
115
115
|
port_ocean/log/logger_setup.py,sha256=CoEDowe5OwNOL_5clU6Z4faktfh0VWaOTS0VLmyhHjw,2404
|
|
116
116
|
port_ocean/log/sensetive.py,sha256=lVKiZH6b7TkrZAMmhEJRhcl67HNM94e56x12DwFgCQk,2920
|
|
117
117
|
port_ocean/middlewares.py,sha256=9wYCdyzRZGK1vjEJ28FY_DkfwDNENmXp504UKPf5NaQ,2727
|
|
118
|
-
port_ocean/ocean.py,sha256=
|
|
118
|
+
port_ocean/ocean.py,sha256=zSJeQ08sQPiSLGa5Qyl06_hrM8GtAu4ZoJMvVVb4OyU,4972
|
|
119
119
|
port_ocean/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
120
120
|
port_ocean/run.py,sha256=rTxBlrQd4yyrtgErCFJCHCEHs7d1OXrRiJehUYmIbN0,2212
|
|
121
121
|
port_ocean/sonar-project.properties,sha256=X_wLzDOkEVmpGLRMb2fg9Rb0DxWwUFSvESId8qpvrPI,73
|
|
@@ -142,8 +142,8 @@ port_ocean/utils/repeat.py,sha256=0EFWM9d8lLXAhZmAyczY20LAnijw6UbIECf5lpGbOas,32
|
|
|
142
142
|
port_ocean/utils/signal.py,sha256=K-6kKFQTltcmKDhtyZAcn0IMa3sUpOHGOAUdWKgx0_E,1369
|
|
143
143
|
port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
|
|
144
144
|
port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
|
|
145
|
-
port_ocean-0.12.9.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
146
|
-
port_ocean-0.12.9.dist-info/METADATA,sha256=
|
|
147
|
-
port_ocean-0.12.9.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
148
|
-
port_ocean-0.12.9.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
|
|
149
|
-
port_ocean-0.12.9.dist-info/RECORD,,
|
|
145
|
+
port_ocean-0.12.9.dev1.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
146
|
+
port_ocean-0.12.9.dev1.dist-info/METADATA,sha256=uW3sO9Lg2ZDEKDTayJCVgRIraS2xpiJ1Wr3tuHyNneU,6678
|
|
147
|
+
port_ocean-0.12.9.dev1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
148
|
+
port_ocean-0.12.9.dev1.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
|
|
149
|
+
port_ocean-0.12.9.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|