OPT project structure
This commit is contained in:
parent
f5d32cfd71
commit
f0ce386a78
1110
openapi.json
1110
openapi.json
File diff suppressed because it is too large
Load Diff
@ -27,18 +27,5 @@ schiphol = "src.main:main"
|
|||||||
requires = ["setuptools>=61.0"]
|
requires = ["setuptools>=61.0"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools]
|
||||||
where = ["."]
|
packages = ["src"]
|
||||||
include = ["src*"]
|
|
||||||
|
|
||||||
[tool.ruff]
|
|
||||||
line-length = 100
|
|
||||||
target-version = "py314"
|
|
||||||
|
|
||||||
[tool.ruff.lint]
|
|
||||||
select = ["E", "F", "I", "UP", "B", "SIM"]
|
|
||||||
ignore = []
|
|
||||||
|
|
||||||
[tool.ruff.format]
|
|
||||||
quote-style = "double"
|
|
||||||
indent-style = "space"
|
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
"""Schiphol flight data producer."""
|
||||||
@ -47,7 +47,9 @@ async def start():
|
|||||||
total_flights = 0
|
total_flights = 0
|
||||||
|
|
||||||
while next_url:
|
while next_url:
|
||||||
with tracer.start_as_current_span("fetch_page", attributes={"http.url": next_url}):
|
with tracer.start_as_current_span(
|
||||||
|
"fetch_page", attributes={"http.url": next_url}
|
||||||
|
):
|
||||||
response = session.get(next_url)
|
response = session.get(next_url)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
data = response.json()
|
data = response.json()
|
||||||
@ -80,7 +82,9 @@ async def start():
|
|||||||
next_url = link.split(";")[0].strip().strip("<>")
|
next_url = link.split(";")[0].strip().strip("<>")
|
||||||
break
|
break
|
||||||
|
|
||||||
logger.info(f"Published {total_flights} flights to Kafka topic '{kafka_settings.topic}'")
|
logger.info(
|
||||||
|
f"Published {total_flights} flights to Kafka topic '{kafka_settings.topic}'"
|
||||||
|
)
|
||||||
|
|
||||||
await stream_engine.stop()
|
await stream_engine.stop()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user