노래 생성 후 blob 업로드 완료
This commit is contained in:
1 parent
62dd681b83
commit
586dd5ccc9
2 files changed
+130
-8
No files matched your search
@@ -32,7 +32,7 @@ from app.song.schemas.song_schema import (
|
||||
PollingSongResponse,
|
||||
SongListItem,
|
||||
)
|
||||
from app.song.worker.song_task import download_and_upload_song_to_blob
|
||||
from app.song.worker.song_task import download_and_upload_song_by_suno_task_id
|
||||
from app.utils.pagination import PaginatedResponse
|
||||
from app.utils.suno import SunoService
|
||||
|
||||
@@ -243,7 +243,7 @@ async def get_song_status(
|
||||
audio_url = first_clip.audio_url
|
||||
|
||||
if audio_url:
|
||||
# suno_task_id로 Song 조회하여 task_id 가져오기 (여러 개 있을 경우 가장 최근 것 선택)
|
||||
# suno_task_id로 Song 조회하여 store_name 가져오기
|
||||
song_result = await session.execute(
|
||||
select(Song)
|
||||
.where(Song.suno_task_id == suno_task_id)
|
||||
@@ -253,7 +253,7 @@ async def get_song_status(
|
||||
song = song_result.scalar_one_or_none()
|
||||
|
||||
if song:
|
||||
# task_id로 Project 조회하여 store_name 가져오기
|
||||
# project_id로 Project 조회하여 store_name 가져오기
|
||||
project_result = await session.execute(
|
||||
select(Project).where(Project.id == song.project_id)
|
||||
)
|
||||
@@ -261,11 +261,11 @@ async def get_song_status(
|
||||
|
||||
store_name = project.store_name if project else "song"
|
||||
|
||||
# 백그라운드 태스크로 MP3 다운로드 및 Blob 업로드, DB 업데이트
|
||||
print(f"[get_song_status] Background task args - task_id: {song.task_id}, audio_url: {audio_url}, store_name: {store_name}")
|
||||
# 백그라운드 태스크로 MP3 다운로드 및 Blob 업로드, DB 업데이트 (suno_task_id 사용)
|
||||
print(f"[get_song_status] Background task args - suno_task_id: {suno_task_id}, audio_url: {audio_url}, store_name: {store_name}")
|
||||
background_tasks.add_task(
|
||||
download_and_upload_song_to_blob,
|
||||
task_id=song.task_id,
|
||||
download_and_upload_song_by_suno_task_id,
|
||||
suno_task_id=suno_task_id,
|
||||
audio_url=audio_url,
|
||||
store_name=store_name,
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user