fix(d2): datetime.now(UTC) everywhere + SQLITE-001 automation tests on ephemeral postgres
Check Cross-Plugin Imports / check (push) Has been cancelled

This commit is contained in:
Agent Zero
2026-08-24 01:22:42 +02:00
parent 5e0ffd91c2
commit d89044d8f7
6 changed files with 115 additions and 31 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import csv
import io
import json
import uuid
from datetime import datetime, timedelta
from datetime import UTC, datetime, timedelta
from fastapi import APIRouter, Depends, HTTPException, Query
from fastapi.responses import StreamingResponse
@@ -167,7 +167,7 @@ async def audit_retention_cleanup(
Default retention: 365 days.
"""
tenant_id = uuid.UUID(current_user["tenant_id"])
cutoff = datetime.utcnow() - timedelta(days=retention_days)
cutoff = datetime.now(UTC) - timedelta(days=retention_days)
q = delete(AuditLog).where(
AuditLog.tenant_id == tenant_id,