event_service.go 433 字节
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))
			}
		}()
		time.Sleep(time.Second * 1)
		e.FireEvent()
	}()
}