mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-24 07:55:07 +01:00
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:
parent
f7fdf8d8ce
commit
3cec6229ad
1 changed files with 9 additions and 1 deletions
|
@ -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()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue