Skip to content

Commit

Permalink
remove logs from beat
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Nov 9, 2024
1 parent fb41329 commit 1c1e2a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
14 changes: 7 additions & 7 deletions backend/danswer/background/celery/apps/beat.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ def tick(self) -> float:
self._last_reload is None
or (now - self._last_reload) > self._reload_interval
):
logger.info("Reload interval reached, initiating tenant task update")
logger.info("Reload interval reached, initiating task update")
self._update_tenant_tasks()
self._last_reload = now
logger.info("Tenant task update completed, reset reload timer")
logger.info("Task update completed, reset reload timer")
return retval

def _update_tenant_tasks(self) -> None:
logger.info("Starting tenant task update process")
logger.info("Starting task update process")
try:
logger.info("Fetching all tenant IDs")
tenant_ids = get_all_tenant_ids()
logger.info(f"Found {len(tenant_ids)} tenants")
logger.info(f"Found {len(tenant_ids)} items")

logger.info("Fetching tasks to schedule")
tasks_to_schedule = fetch_versioned_implementation(
Expand All @@ -68,11 +68,11 @@ def _update_tenant_tasks(self) -> None:
for task_name, _ in current_schedule:
if "-" in task_name:
existing_tenants.add(task_name.split("-")[-1])
logger.info(f"Found {len(existing_tenants)} existing tenants in schedule")
logger.info(f"Found {len(existing_tenants)} existing items in schedule")

for tenant_id in tenant_ids:
if tenant_id not in existing_tenants:
logger.info(f"Processing new tenant: {tenant_id}")
logger.info(f"Processing new item: {tenant_id}")

for task in tasks_to_schedule():
task_name = f"{task['name']}-{tenant_id}"
Expand Down Expand Up @@ -121,7 +121,7 @@ def _update_tenant_tasks(self) -> None:
except (AttributeError, KeyError) as e:
logger.exception(f"Failed to process task configuration: {str(e)}")
except Exception as e:
logger.exception(f"Unexpected error updating tenant tasks: {str(e)}")
logger.exception(f"Unexpected error updating tasks: {str(e)}")

def _should_update_schedule(
self, current_schedule: dict, new_schedule: dict
Expand Down
3 changes: 1 addition & 2 deletions backend/danswer/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
from danswer.natural_language_processing.search_nlp_models import warm_up_cross_encoder
from danswer.search.models import SavedSearchSettings
from danswer.search.retrieval.search_runner import download_nltk_data
from danswer.seeding.load_docs import seed_initial_documents
from danswer.server.manage.llm.models import LLMProviderUpsertRequest
from danswer.server.settings.store import load_settings
from danswer.server.settings.store import store_settings
Expand Down Expand Up @@ -148,7 +147,7 @@ def setup_danswer(db_session: Session, tenant_id: str | None) -> None:
# update multipass indexing setting based on GPU availability
update_default_multipass_indexing(db_session)

seed_initial_documents(db_session, tenant_id)
# seed_initial_documents(db_session, tenant_id)


def translate_saved_search_settings(db_session: Session) -> None:
Expand Down

0 comments on commit 1c1e2a5

Please sign in to comment.