diff --git a/taskiq_dependencies/ctx.py b/taskiq_dependencies/ctx.py index 204ada3..285a5e2 100644 --- a/taskiq_dependencies/ctx.py +++ b/taskiq_dependencies/ctx.py @@ -203,7 +203,7 @@ def resolver(self, executed_func: Any, initial_cache: Dict[Any, Any]) -> Any: :return: dict with resolved kwargs. """ - if getattr(executed_func, "dep_graph", False): + if inspect.getattr_static(executed_func, "dep_graph", False): ctx = SyncResolveContext(executed_func, self.main_graph, initial_cache) self.sub_contexts.append(ctx) sub_result = ctx.resolve_kwargs() @@ -331,7 +331,7 @@ async def resolver( :param initial_cache: cache to build a context if graph was passed. :return: dict with resolved kwargs. """ - if getattr(executed_func, "dep_graph", False): + if inspect.getattr_static(executed_func, "dep_graph", False): ctx = AsyncResolveContext(executed_func, self.main_graph, initial_cache) # type: ignore self.sub_contexts.append(ctx) sub_result = await ctx.resolve_kwargs()