From ff2dbadc9d45c31bbb686836b640edc79f3e944f Mon Sep 17 00:00:00 2001 From: Saba Date: Sat, 14 Oct 2023 13:28:34 -0700 Subject: [PATCH] Use computed plaintext_content to set file content rather than calling f.read again --- src/khoj/utils/fs_syncer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/khoj/utils/fs_syncer.py b/src/khoj/utils/fs_syncer.py index d303d39b..8f398104 100644 --- a/src/khoj/utils/fs_syncer.py +++ b/src/khoj/utils/fs_syncer.py @@ -74,7 +74,7 @@ def get_plaintext_files(config: TextContentConfig) -> dict[str, str]: plaintext_content = f.read() if file.endswith(("html", "htm", "xml")): plaintext_content = extract_html_content(plaintext_content) - filename_to_content_map[file] = f.read() + filename_to_content_map[file] = plaintext_content except Exception as e: logger.warning(f"Unable to read file: {file} as plaintext. Skipping file.") logger.warning(e, exc_info=True)