De-duplication #45
Code-Over-Time
announced in
Tasks: Senior
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Category: Backend Development
Level: Senior
Description
The Matchmaker and Stats Tracker projects are quite similar in how they operate. Both are web servers that use Flask. Both store data in Redis. And both also have a background process that runs independently of the web server, processing data in the background.
Currently both projects actually use the exact same code to run their background processes - however is code is duplicated across both projects, which is a problem.
If we want to change this code we have to do it in two places, which results in additional development overhead and can lead to inconsistencies (imagine if you make a change in one place but forget to update the other, resulting in different behavior from what you thought was the same code!).
We need to extract this code out of both the matchmaker and stat tracker projects, create a library from it and then use that library in both projects.
This way if we need to make changes to this code we only need to do it once, and then run that code in both projects.
The code in question exists in:
matchmaker/matchmaker/workers/worker_manager.py
stats_tracker/stats_tracker/workers/worker_manager.py
If you open both those files you should find them to be exactly the same.
Deliverable
A new Python library that contains the
worker_manager
code that is currently duplicated in both the matchmaker and stats_tracker projects. This library should also include tests (there are existing tests for the worker manager).Updated matchmaker project that:
Updated stats_tracker project that:
Updated build scripts to ensure the new library is loaded correctly as a dependency when building new docker images.
Acceptance Criteria
Task Tips!
game_rps/game_engine
and how it is integrated in both the client and server projects.Beta Was this translation helpful? Give feedback.
All reactions