上传素材接口,增加3次请求

This commit is contained in:
18610128193
2026-06-26 11:13:34 +08:00
parent ae850de128
commit 6be98fe3bf
3 changed files with 8 additions and 5 deletions
+3 -2
View File
@@ -1,14 +1,15 @@
# App # App
APP_NAME=VideoGen API APP_NAME=VideoGen API
APP_VERSION=1.0.0 APP_VERSION=1.0.0
DEBUG=false DEBUG=true
SECRET_KEY=local-dev-secret-key-not-for-production SECRET_KEY=local-dev-secret-key-not-for-production
# Database (PostgreSQL) # Database (PostgreSQL)
#DATABASE_URL=postgresql+asyncpg://videogen_test:Yr7kM7kDj75izCiA@180.184.42.66:5432/videogen_test
DATABASE_URL=postgresql+asyncpg://videogen:7k33pnXdPL62Yyb4@180.184.42.66:5432/videogen DATABASE_URL=postgresql+asyncpg://videogen:7k33pnXdPL62Yyb4@180.184.42.66:5432/videogen
# Redis (leave empty to disable - rate limiting and captcha will use in-memory fallback) # Redis (leave empty to disable - rate limiting and captcha will use in-memory fallback)
REDIS_URL=redis://localhost:6379/3 REDIS_URL=redis://127.0.0.1:6379/0
CELERY_BROKER_URL=redis://localhost:6379/5 CELERY_BROKER_URL=redis://localhost:6379/5
CELERY_RESULT_BACKEND=redis://localhost:6379/6 CELERY_RESULT_BACKEND=redis://localhost:6379/6
+4 -2
View File
@@ -34,7 +34,8 @@ class DouyinApi:
oauth_id, oauth_id,
url, url,
'POST', 'POST',
options options,
request_count = 3
) )
#上传视频素材 #上传视频素材
@@ -52,7 +53,8 @@ class DouyinApi:
oauth_id, oauth_id,
url, url,
'POST', 'POST',
options options,
request_count = 3
) )
#获取区域信息 #获取区域信息
+1 -1
View File
@@ -9,7 +9,7 @@ async def init_redis() -> None:
return return
try: try:
from redis.asyncio import Redis from redis.asyncio import Redis
redis_client = Redis.from_url(settings.REDIS_URL, decode_responses=True) redis_client = Redis.from_url(settings.REDIS_URL, decode_responses=True, protocol=2)
await redis_client.ping() await redis_client.ping()
except Exception: except Exception:
redis_client = None redis_client = None