event_service.go 578 字节
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"
)

// AsyncEvent 同步事件
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 * 100)
	log.Logger.Info("结束事件..." + e.Type.ToString())
}