refactor(service): 重构服务模块结构并优化模型配置

This commit is contained in:
2026-05-29 17:54:19 +08:00
parent e487b4bb5e
commit d409b84b58
24 changed files with 943 additions and 1158 deletions

View File

@@ -3,13 +3,14 @@ package main
import (
"context"
"model-gateway/model/dto"
"model-gateway/service/job"
"model-gateway/service/task"
"os"
"os/signal"
"syscall"
"time"
"model-gateway/controller"
"model-gateway/service"
"gitea.com/red-future/common/http"
"gitea.com/red-future/common/jaeger"
@@ -62,7 +63,7 @@ func startAutoRunner(ctx context.Context) {
case <-ctx.Done():
return
case <-ticker.C:
if _, err := service.AsyncWorker.RunOnce(ctx, &dto.RunWorkReq{
if _, err := task.AsyncWorker.RunOnce(ctx, &dto.RunWorkReq{
BatchSize: batchSize,
Goroutines: goroutines,
}); err != nil {
@@ -87,7 +88,7 @@ func startAutoRunner(ctx context.Context) {
case <-ctx.Done():
return
case <-ticker.C:
_, _ = service.Cleaner.RunOnce(ctx)
_, _ = job.Cleaner.RunOnce(ctx)
}
}
}()