This pull request introduces significant changes to the matching service, including environment configuration, Docker setup, and the implementation of Redis-based matching logic. The most important changes include adding environment variables, updating the Docker configuration, modifying the .gitignore file, defining a new data model, and implementing Redis utilities and endpoints for the matching service.
Environment Configuration:
.env.sample: Added environment variables for the matching service, including MATCHING_SVC_PORT and MATCHING_SVC_REDIS_PORT.
Docker Configuration:
Access redis without needing to download it. Docker gotcha back: http://localhost:5540
Codebase Simplification:
matching-service/.gitignore: Simplified the .gitignore file to ignore all __pycache__ directories recursively.
matching-service/app/routers/match.py: Implemented endpoints for queuing users and retrieving matched pairs, and added a startup event to listen for matches.
matching-service/app/utils/redis_utils.py: Added Redis utility functions for connecting to Redis, acquiring and releasing locks, building queue keys, listening for matches, and finding or enqueuing matches.
This pull request introduces significant changes to the matching service, including environment configuration, Docker setup, and the implementation of Redis-based matching logic. The most important changes include adding environment variables, updating the Docker configuration, modifying the
.gitignore
file, defining a new data model, and implementing Redis utilities and endpoints for the matching service.Environment Configuration:
.env.sample
: Added environment variables for the matching service, includingMATCHING_SVC_PORT
andMATCHING_SVC_REDIS_PORT
.Docker Configuration:
Access redis without needing to download it. Docker gotcha back: http://localhost:5540
Codebase Simplification:
matching-service/.gitignore
: Simplified the.gitignore
file to ignore all__pycache__
directories recursively.New Data Model:
matching-service/app/models/match.py
: Defined a newMatchData
model using Pydantic to represent match data.Redis Utilities and Endpoints:
matching-service/app/routers/match.py
: Implemented endpoints for queuing users and retrieving matched pairs, and added a startup event to listen for matches.matching-service/app/utils/redis_utils.py
: Added Redis utility functions for connecting to Redis, acquiring and releasing locks, building queue keys, listening for matches, and finding or enqueuing matches.