Fix miscellaneous import, logging, html page title

This commit is contained in:
sabaimran 2023-10-25 21:19:11 -07:00
parent e02d751eb3
commit a3f393edb4
5 changed files with 7 additions and 9 deletions

View file

@ -25,7 +25,6 @@ from khoj.utils import constants, state
from khoj.utils.config import (
SearchType,
)
from khoj.utils.helpers import merge_dicts
from khoj.utils.fs_syncer import collect_files
from khoj.utils.rawconfig import FullConfig
from khoj.routers.indexer import configure_content, load_content, configure_search
@ -184,7 +183,7 @@ def configure_search_types(config: FullConfig):
core_search_types = {e.name: e.value for e in SearchType}
# Dynamically generate search type enum by merging core search types with configured plugin search types
return Enum("SearchType", merge_dicts(core_search_types, {}))
return Enum("SearchType", core_search_types)
@schedule.repeat(schedule.every(59).minutes)

View file

@ -2,7 +2,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=1.0">
<title>Khoj - Search</title>
<title>Khoj - Login</title>
<link rel="icon" type="image/png" sizes="128x128" href="/static/assets/icons/favicon-128x128.png">
<link rel="manifest" href="/static/khoj.webmanifest">

View file

@ -15,14 +15,11 @@ warnings.filterwarnings("ignore", message=r"legacy way to download files from th
# External Packages
import uvicorn
import django
import schedule
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from rich.logging import RichHandler
import schedule
from fastapi.staticfiles import StaticFiles
from rich.logging import RichHandler
import schedule
from django.core.asgi import get_asgi_application
from django.core.management import call_command

View file

@ -144,7 +144,7 @@ class TextEmbeddings(ABC):
)
)
new_embeddings = Embeddings.objects.bulk_create(batch_embeddings_to_create)
logger.info(f"Created {new_embeddings.count()} new embeddings")
logger.info(f"Created {len(new_embeddings)} new embeddings")
num_new_embeddings += len(new_embeddings)
dates_to_create = []
@ -160,7 +160,7 @@ class TextEmbeddings(ABC):
)
new_dates = EmbeddingsDates.objects.bulk_create(dates_to_create)
if len(new_dates) > 0:
logger.info(f"Created {new_dates.count()} new date entries")
logger.info(f"Created {len(new_dates)} new date entries")
with timer("Identify hashes for removed entries", logger):
for file in hashes_by_file:

View file

@ -158,6 +158,8 @@ async def update(
host=host,
)
logger.info(f"📪 Content index updated via API call by {client} client")
return Response(content="OK", status_code=200)