Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuo-danswer committed Nov 21, 2024
1 parent f25ad1e commit 3b3008f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
2 changes: 0 additions & 2 deletions backend/danswer/background/celery/tasks/indexing/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ def should_stop(self) -> bool:
return False

def progress(self, tag: str, amount: int) -> None:
# logger.debug(f"IndexingCallback: tag={tag} amount={amount}")

try:
self.redis_lock.reacquire()
self.last_tag = tag
Expand Down
37 changes: 0 additions & 37 deletions backend/danswer/indexing/indexing_heartbeat.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,6 @@
from abc import ABC
from abc import abstractmethod

from danswer.utils.logger import setup_logger

# from danswer.db.index_attempt import get_index_attempt

logger = setup_logger()


# class Heartbeat(abc.ABC):
# """Useful for any long-running work that goes through a bunch of items
# and needs to occasionally give updates on progress.
# e.g. chunking, embedding, updating vespa, etc."""

# @abc.abstractmethod
# def heartbeat(self, metadata: Any = None) -> None:
# raise NotImplementedError


# class IndexingHeartbeat(Heartbeat):
# def __init__(self, index_attempt_id: int, db_session: Session, freq: int):
# self.cnt = 0

# self.index_attempt_id = index_attempt_id
# self.db_session = db_session
# self.freq = freq

# def heartbeat(self, metadata: Any = None) -> None:
# self.cnt += 1
# if self.cnt % self.freq == 0:
# index_attempt = get_index_attempt(
# db_session=self.db_session, index_attempt_id=self.index_attempt_id
# )
# if index_attempt:
# index_attempt.time_updated = func.now()
# self.db_session.commit()
# else:
# logger.error("Index attempt not found, this should not happen!")


class IndexingHeartbeatInterface(ABC):
"""Defines a callback interface to be passed to
Expand Down

0 comments on commit 3b3008f

Please sign in to comment.