|
@@ -3,6 +3,7 @@ package main
|
|
|
import (
|
|
|
"fmt"
|
|
|
_ "hongze/hongze_robot/routers"
|
|
|
+ "hongze/hongze_robot/services"
|
|
|
"hongze/hongze_robot/utils"
|
|
|
"runtime"
|
|
|
"time"
|
|
@@ -17,11 +18,11 @@ func main() {
|
|
|
web.BConfig.WebConfig.DirectoryIndex = true
|
|
|
web.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
|
|
}
|
|
|
+ go services.Task()
|
|
|
web.BConfig.RecoverFunc = Recover
|
|
|
web.Run()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
func Recover(ctx *context.Context, conf *web.Config) {
|
|
|
if err := recover(); err != nil {
|
|
|
if err == web.ErrAbort {
|
|
@@ -51,4 +52,4 @@ func Recover(ctx *context.Context, conf *web.Config) {
|
|
|
go utils.SendEmail(utils.APPNAME+"崩了"+time.Now().Format("2006-01-02 15:04:05"), stack, utils.EmailSendToUsers)
|
|
|
}
|
|
|
return
|
|
|
-}
|
|
|
+}
|