업로드 시간 수정 .

subtitle
hbyang 2026-03-06 14:43:10 +09:00
parent 41087b5fda
commit d7a649809f
1 changed files with 5 additions and 2 deletions

View File

@ -178,8 +178,11 @@ async def upload_to_social(
) )
# 6. 백그라운드 태스크 등록 (즉시 업로드 or 예약 없을 때만) # 6. 백그라운드 태스크 등록 (즉시 업로드 or 예약 없을 때만)
from app.utils.timezone import now as utcnow # scheduled_at은 naive datetime (클라이언트에서 KST 기준으로 전송)
is_scheduled = body.scheduled_at and body.scheduled_at > utcnow().replace(tzinfo=None) # config의 TIMEZONE(KST) 기준 현재 시간과 비교
from config import TIMEZONE
now_kst_naive = datetime.now(TIMEZONE).replace(tzinfo=None)
is_scheduled = body.scheduled_at and body.scheduled_at > now_kst_naive
if not is_scheduled: if not is_scheduled:
background_tasks.add_task(process_social_upload, social_upload.id) background_tasks.add_task(process_social_upload, social_upload.id)