feat: 平台同步状态记录(last_synced_at + 前端展示最后同步时间)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
"""
|
||||
|
||||
import json
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
@@ -217,4 +218,8 @@ def sync_provider(session: Session, provider_id: int) -> dict:
|
||||
except Exception as e: # noqa: BLE001
|
||||
result["account_error"] = str(e)
|
||||
|
||||
provider.last_synced_at = datetime.utcnow()
|
||||
session.add(provider)
|
||||
session.commit()
|
||||
result["last_synced_at"] = provider.last_synced_at.isoformat()
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user