Error occurred when fetching sidebar data
Refactor: Add interface mimicking future noSQL and add SQL implementation
-
Add interface/abstract class called "DataSource" (open for suggestions) that defines methods that will be used from the noSQL DB. Check https://codimd.web.cern.ch/gwpZS3rPTvGEmcEeTnNHYw#noSQL-DB documents and pseudo-code.
You can use python's ABC module: Example: https://www.geeksforgeeks.org/abstract-classes-in-python/
-
Add class implementation called PostgresDataSource that implements the required methods from the interface. Some things will be just moving around and copy/paste and others will required more work.
-
Refactor on_message to use the new class PostgresDataSource and the new pseudo-code.