update see calss

This commit is contained in:
2026-08-23 22:03:57 +02:00
parent f3d4fb56ed
commit 8983cfc8a1
32 changed files with 1884 additions and 22 deletions
+9
View File
@@ -11,6 +11,7 @@ import (
"syscall"
"time"
"github.com/descrybe/descrybe-v2/apps/api/internal/aiaudit"
"github.com/descrybe/descrybe-v2/apps/api/internal/aiprompts"
"github.com/descrybe/descrybe-v2/apps/api/internal/aiprovider"
"github.com/descrybe/descrybe-v2/apps/api/internal/billing"
@@ -95,6 +96,9 @@ func main() {
ProcessingMaxRetries: cfg.ProcessingMaxRetries,
})
aiSvc.Platform = platSettings
// Full prompt/response capture for /admin/ai-calls (pruned after
// aiaudit.RetentionDays by the retention tick below).
aiSvc.WithAudit(aiaudit.NewRecorder(pool))
pipeline := processing.NewPipeline(pool)
pipeline.BatchSize = cfg.ProcessingBatchSize
@@ -371,6 +375,11 @@ func main() {
} else if res.JobsDeleted > 0 {
log.Printf("retention cleanup jobs_deleted=%d", res.JobsDeleted)
}
if n, err := aiaudit.CleanupExpired(ctx, pool); err != nil {
log.Printf("worker: ai call log cleanup: %v", err)
} else if n > 0 {
log.Printf("worker: ai call log cleanup removed=%d older_than_days=%d", n, aiaudit.RetentionDays)
}
if res, err := processing.CleanupExpiredSyncJobs(ctx, pool); err != nil {
log.Printf("expired sync cleanup: %v", err)
} else if res.SyncJobsDeleted > 0 {