定时任务细化,签到成功页结果展示
This commit is contained in:
@@ -3,6 +3,8 @@ Weibo-HotSign API Service
|
||||
Main FastAPI application entry point — account management, task config, signin logs.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.exceptions import RequestValidationError
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
@@ -11,6 +13,15 @@ from starlette.exceptions import HTTPException as StarletteHTTPException
|
||||
from shared.response import success_response, error_response
|
||||
from api_service.app.routers import accounts, tasks, signin_logs
|
||||
|
||||
|
||||
# 过滤 /health 的 access log,避免日志刷屏
|
||||
class _HealthFilter(logging.Filter):
|
||||
def filter(self, record: logging.LogRecord) -> bool:
|
||||
msg = record.getMessage()
|
||||
return "/health" not in msg
|
||||
|
||||
logging.getLogger("uvicorn.access").addFilter(_HealthFilter())
|
||||
|
||||
app = FastAPI(
|
||||
title="Weibo-HotSign API Service",
|
||||
version="1.0.0",
|
||||
|
||||
Reference in New Issue
Block a user