Fix event loop (#32)

* Fix main by ensuring a new event loop is created
* fix Dockerfile workspace error
This commit was merged in pull request #32.
This commit is contained in:
Giacomo Bertolazzi
2025-10-13 22:34:28 +02:00
committed by GitHub
parent c96617a039
commit d85d6ed1eb
2 changed files with 4 additions and 5 deletions

View File

@@ -9,9 +9,6 @@ ENV PATH="/root/.local/bin:$PATH"
# Configuriamo UV per usare copy mode ed evitare problemi di linking
ENV UV_LINK_MODE=copy
# Impostiamo la directory di lavoro
WORKDIR /app
# Copiamo i file del progetto
COPY pyproject.toml ./
COPY uv.lock ./
@@ -21,7 +18,7 @@ COPY configs.yaml ./
# Creiamo l'ambiente virtuale con tutto già presente
RUN uv sync
ENV PYTHONPATH="/app/src"
ENV PYTHONPATH="/src"
# Comando di avvio dell'applicazione
CMD ["uv", "run", "src/app"]

View File

@@ -24,7 +24,9 @@ if __name__ == "__main__":
except AssertionError as e:
try:
logging.warning(f"Telegram bot could not be started: {e}")
asyncio.get_event_loop().run_forever()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_forever()
except KeyboardInterrupt:
logging.info("Shutting down due to KeyboardInterrupt")
finally: