event_service.go 551 字节
package domainService

import (
	"fmt"
	"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/domain"
	"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/log"
	"time"
)

func AsyncEvent(e *domain.EventTable) {
	go func() {
		defer func() {
			if p := recover(); p != nil {
				log.Logger.Error(fmt.Sprintf("%v", p))
			}
		}()
		e.FireEvent()
	}()
	log.Logger.Info("开始事件..." + e.Type.ToString())
	time.Sleep(time.Millisecond * 400)
	log.Logger.Info("结束事件..." + e.Type.ToString())
}