Skip to content

Commit

Permalink
fix user group
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Kuo (Danswer) committed Feb 6, 2025
1 parent 74329a0 commit 74b8ebc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions backend/ee/onyx/db/user_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ def fetch_user_groups_for_user(
return db_session.scalars(stmt).all()


def construct_document_select_by_usergroup(
def construct_document_id_select_by_usergroup(
user_group_id: int,
) -> Select:
"""This returns a statement that should be executed using
.yield_per() to minimize overhead. The primary consumers of this function
are background processing task generators."""
stmt = (
select(Document)
select(Document.id)
.join(
DocumentByConnectorCredentialPair,
Document.id == DocumentByConnectorCredentialPair.id,
Expand Down
13 changes: 8 additions & 5 deletions backend/onyx/background/celery/tasks/connector_deletion/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,14 @@ def try_generate_document_cc_pair_cleanup_tasks(
if tasks_generated is None:
raise ValueError("RedisConnectorDeletion.generate_tasks returned None")

insert_sync_record(
db_session=db_session,
entity_id=cc_pair_id,
sync_type=SyncType.CONNECTOR_DELETION,
)
try:
insert_sync_record(
db_session=db_session,
entity_id=cc_pair_id,
sync_type=SyncType.CONNECTOR_DELETION,
)
except Exception:
pass

except TaskDependencyError:
redis_connector.delete.set_fence(None)
Expand Down

0 comments on commit 74b8ebc

Please sign in to comment.