Fix event loop #32

Merged
Berack96 merged 2 commits from fix-asyncio-loop into main 2025-10-13 22:34:28 +02:00
Berack96 commented 2025-10-13 20:25:51 +02:00 (Migrated from github.com)

Create a new event loop to handle exceptions properly and update the Dockerfile to set the correct workspace directory.

Create a new event loop to handle exceptions properly and update the Dockerfile to set the correct workspace directory.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-10-13 20:26:21 +02:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR fixes event loop handling in exception scenarios and corrects the Docker workspace configuration. The changes ensure proper event loop management when the Telegram bot fails to start and align the Docker PYTHONPATH with the actual project structure.

  • Creates a new event loop instead of reusing the existing one when handling Telegram bot startup failures
  • Removes explicit WORKDIR declaration in Dockerfile and updates PYTHONPATH to match the actual source directory structure

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/app/main.py Replaces asyncio.get_event_loop() with explicit new event loop creation for better exception handling
Dockerfile Removes WORKDIR directive and updates PYTHONPATH from /app/src to /src

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

## Pull Request Overview This PR fixes event loop handling in exception scenarios and corrects the Docker workspace configuration. The changes ensure proper event loop management when the Telegram bot fails to start and align the Docker PYTHONPATH with the actual project structure. - Creates a new event loop instead of reusing the existing one when handling Telegram bot startup failures - Removes explicit WORKDIR declaration in Dockerfile and updates PYTHONPATH to match the actual source directory structure ### Reviewed Changes Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment. | File | Description | | ---- | ----------- | | src/app/__main__.py | Replaces `asyncio.get_event_loop()` with explicit new event loop creation for better exception handling | | Dockerfile | Removes WORKDIR directive and updates PYTHONPATH from `/app/src` to `/src` | --- <sub>**Tip:** Customize your code reviews with copilot-instructions.md. <a href="/Berack96/upo-appAI/new/main/.github?filename=copilot-instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Create the file</a> or <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">learn how to get started</a>.</sub>
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-13 20:26:21 +02:00

The PYTHONPATH is set to /src but without an explicit WORKDIR, the container's working directory defaults to /. This means the path /src may not exist unless the source files are copied to the root /src directory. Consider either restoring WORKDIR /app or ensuring source files are copied to /src.

The PYTHONPATH is set to `/src` but without an explicit WORKDIR, the container's working directory defaults to `/`. This means the path `/src` may not exist unless the source files are copied to the root `/src` directory. Consider either restoring `WORKDIR /app` or ensuring source files are copied to `/src`.
Sign in to join this conversation.