-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fbb4da
commit 2158178
Showing
3 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
import structlog | ||
from celery import shared_task | ||
|
||
# from ee.session_recordings.ai.generate_embeddings import ( | ||
# generate_recording_embedding, | ||
# fetch_recordings_without_embeddings, | ||
# ) | ||
from ee.session_recordings.ai.generate_embeddings import ( | ||
fetch_recordings_without_embeddings, | ||
generate_recording_embeddings, | ||
) | ||
from posthog.tasks.utils import CeleryQueue | ||
|
||
logger = structlog.get_logger(__name__) | ||
|
||
|
||
# just so we can merge into another PR | ||
@shared_task(ignore_result=True, queue=CeleryQueue.SESSION_REPLAY_EMBEDDINGS.value) | ||
def embed_single_recording(session_id: str, team_id: int) -> None: | ||
# generate_recording_embedding(session_id, team_id) | ||
pass | ||
generate_recording_embeddings(session_id, team_id) | ||
|
||
|
||
# just so we can merge into another PR | ||
@shared_task(ignore_result=True) | ||
def generate_recording_embeddings() -> None: | ||
# recordings = fetch_recordings_without_embeddings() | ||
# for recording in []: # recordings: | ||
# # push each embedding task to a separate queue | ||
# embed_single_recording.delay(recording.session_id, recording.team_id) | ||
pass | ||
def generate_recordings_embeddings_batch() -> None: | ||
for recording in fetch_recordings_without_embeddings(): | ||
# push each embedding task to a separate queue | ||
# TODO really we should be doing scatter and gather here | ||
# so we can do one CH update at the end of a batch | ||
embed_single_recording.delay(recording.session_id, recording.team_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters