Skip to content

Commit

Permalink
address race conditions causing youtube lectures to sometime fail
Browse files Browse the repository at this point in the history
  • Loading branch information
nattvara committed Sep 17, 2023
1 parent 5b8bd0d commit eddec10
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 eddec10

Please sign in to comment.