file: add taskqueue worker process image thumbnail
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 30s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 30s
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"godemo/file/internal/config"
|
||||
"godemo/file/internal/server"
|
||||
"godemo/file/internal/svc"
|
||||
"godemo/file/worker"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/conf"
|
||||
"github.com/zeromicro/go-zero/core/service"
|
||||
@ -25,6 +26,11 @@ func main() {
|
||||
conf.MustLoad(*configFile, &c)
|
||||
ctx := svc.NewServiceContext(c)
|
||||
|
||||
// 初始化任务队列
|
||||
worker.InitImageProcessTaskQueue(1000)
|
||||
// 启动worker池
|
||||
worker.StartImageProcessWorkers(5, ctx)
|
||||
|
||||
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
|
||||
file.RegisterFileServer(grpcServer, server.NewFileServer(ctx))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user