Fix build failure and optimize imports

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-12-13 19:08:35 -03:00
commit 372f39bcad
3 changed files with 2 additions and 6 deletions

View file

@ -178,7 +178,6 @@ async def stream_build(
time_elapsed = format_elapsed_time(time.perf_counter() - start_time) time_elapsed = format_elapsed_time(time.perf_counter() - start_time)
update_build_status(cache_service, flow_id, BuildStatus.FAILURE) update_build_status(cache_service, flow_id, BuildStatus.FAILURE)
vertex_id = vertex.parent_node_id if vertex.parent_is_top_level else vertex.id vertex_id = vertex.parent_node_id if vertex.parent_is_top_level else vertex.id
if vertex_id in graph.top_level_vertices: if vertex_id in graph.top_level_vertices:
response = { response = {

View file

@ -1,7 +1,6 @@
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from langflow.services.cache.service import (BaseCacheService, InMemoryCache, from langflow.services.cache.service import BaseCacheService, InMemoryCache, RedisCache
RedisCache)
from langflow.services.factory import ServiceFactory from langflow.services.factory import ServiceFactory
from langflow.utils.logger import logger from langflow.utils.logger import logger

View file

@ -148,9 +148,7 @@ class DatabaseService(Service):
try: try:
command.check(alembic_cfg) command.check(alembic_cfg)
except Exception as exc: except Exception as exc:
if isinstance( if isinstance(exc, (util.exc.CommandError, util.exc.AutogenerateDiffsDetected)):
exc, (util.exc.CommandError, util.exc.AutogenerateDiffsDetected)
):
command.upgrade(alembic_cfg, "head") command.upgrade(alembic_cfg, "head")
time.sleep(3) time.sleep(3)