redo migration. cleanup commented out code

This commit is contained in:
Mikhail Epifanov
2024-01-11 22:35:58 +01:00
parent bf0462cd74
commit 6a393acd26
5 changed files with 9 additions and 78 deletions

View File

@@ -16,26 +16,4 @@ class Connector(ABC):
async def on_shopping_list_entry_deleted(self, space: Space, instance: ShoppingListEntry) -> None:
pass
# @abstractmethod
# def on_recipe_created(self, instance: Recipe, **kwargs) -> None:
# pass
#
# @abstractmethod
# def on_recipe_updated(self, instance: Recipe, **kwargs) -> None:
# pass
#
# @abstractmethod
# def on_recipe_deleted(self, instance: Recipe, **kwargs) -> None:
# pass
#
# @abstractmethod
# def on_meal_plan_created(self, instance: MealPlan, **kwargs) -> None:
# pass
#
# @abstractmethod
# def on_meal_plan_updated(self, instance: MealPlan, **kwargs) -> None:
# pass
#
# @abstractmethod
# def on_meal_plan_deleted(self, instance: MealPlan, **kwargs) -> None:
# pass
# TODO: Add Recipes & possibly Meal Place listeners/hooks (And maybe more?)

View File

@@ -19,7 +19,6 @@ class ActionType(Enum):
class ConnectorManager:
_connectors: Dict[str, List[Connector]]
_listening_to_classes: UnionType = ShoppingListEntry | Recipe | MealPlan | Connector
max_concurrent_tasks = 2
def __init__(self):
self._connectors = dict()
@@ -79,20 +78,3 @@ class ConnectorManager:
await asyncio.gather(*tasks, return_exceptions=False)
except BaseException as e:
print("received an exception from one of the tasks: ", e)
# if isinstance(instance, Recipe):
# if "created" in kwargs and kwargs["created"]:
# for connector in self._connectors:
# connector.on_recipe_created(instance, **kwargs)
# return
# for connector in self._connectors:
# connector.on_recipe_updated(instance, **kwargs)
# return
#
# if isinstance(instance, MealPlan):
# if "created" in kwargs and kwargs["created"]:
# for connector in self._connectors:
# connector.on_meal_plan_created(instance, **kwargs)
# return
# for connector in self._connectors:
# connector.on_meal_plan_updated(instance, **kwargs)
# return