From 429e1b4b48ff5c0074a76ed17942aa876dedd8ce Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 18 Jul 2023 16:10:47 -0700 Subject: [PATCH] Regenerate index to apply corruption fixes on first run of new khoj --- src/khoj/utils/cli.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/khoj/utils/cli.py b/src/khoj/utils/cli.py index f5c93bb1..49acd6e1 100644 --- a/src/khoj/utils/cli.py +++ b/src/khoj/utils/cli.py @@ -46,7 +46,7 @@ def cli(args=None): if not args.config_file.exists(): args.config = None else: - migrate_config(args) + args = migrate_config(args) args.config = parse_config_from_file(args.config_file) return args @@ -59,3 +59,9 @@ def migrate_config(args): if "version" not in raw_config: raw_config["version"] = args.version_no save_config_to_file(raw_config, args.config_file) + + # regenerate khoj index on first start of this version + # this should refresh index and apply index corruption fixes from #325 + args.regenerate = True + + return args