From 73e2fcf9f1cda2913c5c121b25d7b30a34fbeae6 Mon Sep 17 00:00:00 2001 From: ming luo Date: Tue, 27 Aug 2024 22:10:12 -0400 Subject: [PATCH 1/2] fix auto_saving_interval type --- src/backend/base/langflow/__main__.py | 2 +- src/backend/base/langflow/services/settings/base.py | 2 +- src/backend/base/langflow/utils/util.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/base/langflow/__main__.py b/src/backend/base/langflow/__main__.py index 5e54c7d747c7..b9c30d2702e0 100644 --- a/src/backend/base/langflow/__main__.py +++ b/src/backend/base/langflow/__main__.py @@ -125,7 +125,7 @@ def run( help="Defines if the auto save is enabled.", envvar="LANGFLOW_AUTO_SAVING", ), - auto_saving_interval: bool = typer.Option( + auto_saving_interval: int = typer.Option( True, help="Defines the debounce time for the auto save.", envvar="LANGFLOW_AUTO_SAVING_INTERVAL", diff --git a/src/backend/base/langflow/services/settings/base.py b/src/backend/base/langflow/services/settings/base.py index 2c953b5d14a4..bb775992cfb7 100644 --- a/src/backend/base/langflow/services/settings/base.py +++ b/src/backend/base/langflow/services/settings/base.py @@ -157,7 +157,7 @@ class Settings(BaseSettings): # Config auto_saving: bool = True """If set to True, Langflow will auto save flows.""" - auto_saving_interval: int = 300 + auto_saving_interval: int = 1000 """The interval in ms at which Langflow will auto save flows.""" health_check_max_retries: int = 5 """The maximum number of retries for the health check.""" diff --git a/src/backend/base/langflow/utils/util.py b/src/backend/base/langflow/utils/util.py index aa0cea81210d..b385d1631909 100644 --- a/src/backend/base/langflow/utils/util.py +++ b/src/backend/base/langflow/utils/util.py @@ -429,7 +429,7 @@ def update_settings( components_path: Optional[Path] = None, store: bool = True, auto_saving: bool = True, - auto_saving_interval: int = 300, + auto_saving_interval: int = 1000, health_check_max_retries: int = 5, ): """Update the settings from a config file.""" From 16fbfe7df1831865c2f7a7d64aca9aeae3b8dc46 Mon Sep 17 00:00:00 2001 From: ming luo Date: Tue, 27 Aug 2024 22:29:44 -0400 Subject: [PATCH 2/2] set auto_saving_interval default in typer.Option --- src/backend/base/langflow/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/base/langflow/__main__.py b/src/backend/base/langflow/__main__.py index b9c30d2702e0..8f206b8bd35f 100644 --- a/src/backend/base/langflow/__main__.py +++ b/src/backend/base/langflow/__main__.py @@ -126,7 +126,7 @@ def run( envvar="LANGFLOW_AUTO_SAVING", ), auto_saving_interval: int = typer.Option( - True, + 1000, help="Defines the debounce time for the auto save.", envvar="LANGFLOW_AUTO_SAVING_INTERVAL", ),