feat: auto start workers
This commit is contained in:
@@ -3,10 +3,12 @@ package http
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"backend/modules/commands/store"
|
||||
"backend/modules/medias"
|
||||
"backend/modules/middlewares"
|
||||
"backend/modules/users"
|
||||
wechatModule "backend/modules/wechat"
|
||||
"backend/modules/workers"
|
||||
"backend/providers/app"
|
||||
"backend/providers/hashids"
|
||||
"backend/providers/http"
|
||||
@@ -49,6 +51,8 @@ func Command() atom.Option {
|
||||
users.Provide,
|
||||
medias.Provide,
|
||||
wechatModule.Provide,
|
||||
store.Provide,
|
||||
workers.Provide,
|
||||
)),
|
||||
)
|
||||
}
|
||||
@@ -70,10 +74,12 @@ func Serve(cmd *cobra.Command, args []string) error {
|
||||
if http.App.Mode == app.AppModeDevelopment {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
}
|
||||
|
||||
engine := http.Service.Engine
|
||||
mid := http.Middlewares
|
||||
|
||||
engine.Use(mid.DebugMode)
|
||||
engine.Use(mid.CheckUA)
|
||||
engine.Use(mid.ProcessResponse)
|
||||
engine.Use(mid.WeChatVerify)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user