refactor(model): 重构模型实体和数据访问层

This commit is contained in:
2026-05-21 10:41:37 +08:00
parent a080a5536d
commit 170568e03e
35 changed files with 903 additions and 1072 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"context"
"model-gateway/model/dto"
"os"
"os/signal"
"syscall"
@@ -61,7 +62,10 @@ func startAutoRunner(ctx context.Context) {
case <-ctx.Done():
return
case <-ticker.C:
if _, err := service.AsyncWorker.RunOnce(ctx, batchSize, goroutines); err != nil {
if _, err := service.AsyncWorker.RunOnce(ctx, &dto.RunWorkReq{
BatchSize: batchSize,
Goroutines: goroutines,
}); err != nil {
g.Log().Warningf(ctx, "[auto-worker] run once failed: %v", err)
}
}
@@ -83,7 +87,7 @@ func startAutoRunner(ctx context.Context) {
case <-ctx.Done():
return
case <-ticker.C:
service.Cleaner.RunOnce(ctx)
_, _ = service.Cleaner.RunOnce(ctx)
}
}
}()