Skip to content

Feature/opti#12

Merged
Araon merged 3 commits intomainfrom
feature/opti
Nov 17, 2025
Merged

Feature/opti#12
Araon merged 3 commits intomainfrom
feature/opti

Conversation

@Araon
Copy link
Copy Markdown
Owner

@Araon Araon commented Nov 17, 2025

Coordinator

  • Add thread-safety and concurrency: protect registered_workers with a lock and use a ThreadPoolExecutor for heartbeats and task submissions.
  • Make heartbeats/submissions non-blocking and add request timeouts.
  • Fix timestamp handling (use real datetime objects) and make DB session usage test-friendly (dynamic session factory + no with Session()).
  • Improve testability: accept dict-style inputs for direct method calls and support SKIP_NETWORK_CALLS to disable network heartbeats in tests.

Scheduler

  • Initialize Flask-SQLAlchemy/Migrate for better test overrides (defer/bind properly).
  • Ensure GET /schedule/ response shape matches tests ( {"task": {...}}).

Dev / Docker / tests

  • Update docker-compose.yml for correct build contexts and add a tests service to run pytest inside Compose.
  • Add .env and top-level config.py (env-driven SQLALCHEMY_DATABASE_URI) to centralize config and allow in-memory DB for tests.
  • Add coordinator_service.py shim for test imports and adjust tests to run reliably in containers.

Why: improves scalability (non-blocking coordinator), robustness (timeouts, locks), and testability (config overrides, in-container tests).

@Araon Araon merged commit a451586 into main Nov 17, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant