Integrate event dispatcher into mojangtextures package

This commit is contained in:
ErickSkrauch
2020-02-08 13:28:10 +03:00
parent b2ee10f72f
commit 2abe2db469
13 changed files with 207 additions and 295 deletions

View File

@@ -32,7 +32,7 @@ func (ctx *UUIDsWorker) GetUUID(response http.ResponseWriter, request *http.Requ
username := parseUsername(mux.Vars(request)["username"])
profile, err := ctx.UUIDsProvider.GetUuid(username)
if err != nil {
ctx.Emitter.Emit("uuids_provider:error", err) // TODO: do I need emitter here?
ctx.Emit("uuids_provider:error", err) // TODO: do I need emitter here?
if _, ok := err.(*mojang.TooManyRequestsError); ok {
response.WriteHeader(http.StatusTooManyRequests)
return