Skip to content

Commit

Permalink
fix: remove unnecessary go routines
Browse files Browse the repository at this point in the history
  • Loading branch information
IllTamer committed Mar 13, 2024
1 parent fe09813 commit ef4ffd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions internal/handle/enhance_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package handle
import (
global "github.com/IUnlimit/perpetua/internal"
"github.com/IUnlimit/perpetua/internal/model"
"github.com/bytedance/gopkg/util/gopool"
log "github.com/sirupsen/logrus"
"time"
)
Expand Down Expand Up @@ -72,8 +71,6 @@ func broadcast(trigger *Handler, targets []interface{}, jumpTrigger bool, msgDat
if jumpTrigger && handler.GetId() == trigger.GetId() {
continue
}
gopool.Go(func() {
handler.AddMessage(uuid)
})
handler.AddMessage(uuid)
}
}
4 changes: 1 addition & 3 deletions internal/handle/serve_websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ func readFromNTQQLoop(handle *Handler, conn *websocket.Conn) error {
// when closed, staying dispatch
for _, v := range receivers {
handler := v.(*Handler)
gopool.Go(func() {
handler.AddMessage(uuid)
})
handler.AddMessage(uuid)
}
}
}

0 comments on commit ef4ffd0

Please sign in to comment.