Skip to content

Commit

Permalink
fix(sitemap): upload is not await
Browse files Browse the repository at this point in the history
  • Loading branch information
OrenZhang committed Dec 24, 2024
1 parent f812eb6 commit 4df6504
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/home/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import xml.dom.minidom

from asgiref.sync import async_to_sync
from django.conf import settings
from ovinc_client.core.logger import logger

Expand Down Expand Up @@ -56,4 +57,4 @@ def upload_cos(self) -> None:
if not settings.QCLOUD_SECRET_ID or not settings.QCLOUD_SECRET_KEY:
logger.warning("[Sitemap] QCloud Init Unfinished")
return
COSClient().upload(self.tree.toxml(), "sitemap.xml", ContentType="application/xml")
async_to_sync(COSClient().upload)(self.tree.toxml(), "sitemap.xml", ContentType="application/xml")

0 comments on commit 4df6504

Please sign in to comment.