This commit is contained in:
@ -25,4 +25,4 @@ TTS_PITCH=1.0
|
|||||||
DASHSCOPE_API_KEY=sk-88d6437a6c224ccbb761ec7d994e3b34
|
DASHSCOPE_API_KEY=sk-88d6437a6c224ccbb761ec7d994e3b34
|
||||||
|
|
||||||
# output configuration
|
# output configuration
|
||||||
OUTPUT_PATH=/app/outputs
|
OUTPUT_PATH=outputs
|
||||||
@ -7,5 +7,6 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- /Users/konjacpotato/workspace/data/meme/outputs:/app/outputs
|
- /Users/konjacpotato/workspace/data/meme/outputs:/app/outputs
|
||||||
|
- /Users/konjacpotato/workspace/data/meme/logs:/app/logs
|
||||||
environment:
|
environment:
|
||||||
- ENV=prod
|
- ENV=prod
|
||||||
|
|||||||
2
main.py
2
main.py
@ -1,3 +1,4 @@
|
|||||||
|
from datetime import datetime
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from fastapi.concurrency import asynccontextmanager
|
from fastapi.concurrency import asynccontextmanager
|
||||||
from config.settings import settings
|
from config.settings import settings
|
||||||
@ -45,6 +46,7 @@ def _add_jobs():
|
|||||||
seconds=86400, # 每天运行一次
|
seconds=86400, # 每天运行一次
|
||||||
id="generate-daily-article-job",
|
id="generate-daily-article-job",
|
||||||
replace_existing=True,
|
replace_existing=True,
|
||||||
|
next_run_time=datetime.now(), # 启动即执行一次
|
||||||
)
|
)
|
||||||
logger.info("Job 'generate-daily-article-job' registered.")
|
logger.info("Job 'generate-daily-article-job' registered.")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user