Skip to content

Commit

Permalink
Merge pull request #66 from nattvara/fix-metadata-race-conditions
Browse files Browse the repository at this point in the history
Fix issue where youtube lectures sometimes fail
  • Loading branch information
nattvara authored Sep 17, 2023
2 parents 5b8bd0d + eddec10 commit 30e2960
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions jobs/tasks/lecture/classify_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def job(lecture_id: str, language: str):

logger.info(f'response from openAI: {response}')

lecture.refresh()
lecture.approved = category_is_ok
lecture.save()

Expand Down
1 change: 1 addition & 0 deletions jobs/tasks/lecture/create_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def job(lecture_id: str, language: str):
analysis_id=analysis.id,
)

lecture.refresh()
lecture.description = response
lecture.save()

Expand Down
1 change: 1 addition & 0 deletions jobs/tasks/lecture/fetch_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def job(lecture_id: str, language: str):
else:
raise ValueError(f'unknown source {lecture.source}')

lecture.refresh()
lecture.title = title
lecture.date = date
lecture.group = group
Expand Down

0 comments on commit 30e2960

Please sign in to comment.