Fix caching bug in get_code_tree method

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-11-23 11:49:24 -03:00
commit 2f6a2f3efb

View file

@ -4,7 +4,6 @@ from typing import Any, ClassVar, Optional
from cachetools import TTLCache, cachedmethod
from fastapi import HTTPException
from langflow.interface.custom.code_parser import CodeParser
from langflow.utils import validate
@ -30,7 +29,7 @@ class Component:
for key, value in data.items():
setattr(self, key, value)
@cachedmethod(operator.attrgetter("cache"))
@cachedmethod(cache=operator.attrgetter("cache"))
def get_code_tree(self, code: str):
parser = CodeParser(code)
return parser.parse_code()