Hot swap backend config via config screen start button click

- Update configuration to use by the backend, while app is running
- Trigger after user hits start button with their config.
  The config gets written to khoj.yml file first, then the updated
  config is loaded onto memory
This commit is contained in:
Debanjum Singh Solanky 2022-08-11 00:32:11 +03:00
parent f7fdf8d8ce
commit 3cec6229ad

View file

@ -3,7 +3,9 @@ from PyQt6 import QtWidgets
from PyQt6.QtCore import Qt from PyQt6.QtCore import Qt
# Internal Packages # Internal Packages
from src.utils import constants, yaml as yaml_utils from src.configure import configure_server
from src.utils import constants, state, yaml as yaml_utils
from src.utils.cli import cli
from src.utils.config import SearchType from src.utils.config import SearchType
from src.interface.desktop.file_browser import FileBrowser from src.interface.desktop.file_browser import FileBrowser
@ -80,6 +82,12 @@ class ConfigureScreen(QtWidgets.QDialog):
del config['processor']['conversation'] del config['processor']['conversation']
yaml_utils.save_config_to_file(config, self.config_file) yaml_utils.save_config_to_file(config, self.config_file)
# Load config from app config file
args = cli(state.cli_args)
# Configure server with loaded config
configure_server(args, required=True)
self.hide() self.hide()