mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
redo migration. cleanup commented out code
This commit is contained in:
@@ -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?)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user