refactor(service): 重构服务模块结构并优化模型配置
This commit is contained in:
7
main.go
7
main.go
@@ -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)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user