mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 05:39:54 +05:00
DiameterAgent - handle each request into own goroutine, fixes #1447, thanks @chrisgis333
This commit is contained in:
@@ -111,7 +111,7 @@ func (da *DiameterAgent) handlers() diam.Handler {
|
||||
|
||||
dSM := sm.New(settings)
|
||||
|
||||
dSM.HandleFunc("ALL", da.handleMessage) // route all commands to one dispatcher
|
||||
dSM.HandleFunc("ALL", da.handleMessageAsync) // route all commands to one dispatcher
|
||||
go func() {
|
||||
for err := range dSM.ErrorReports() {
|
||||
utils.Logger.Err(fmt.Sprintf("<%s> sm error: %v", utils.DiameterAgent, err))
|
||||
@@ -120,6 +120,11 @@ func (da *DiameterAgent) handlers() diam.Handler {
|
||||
return dSM
|
||||
}
|
||||
|
||||
// handleMessageAsync will dispatch the message into it's own goroutine
|
||||
func (da *DiameterAgent) handleMessageAsync(c diam.Conn, m *diam.Message) {
|
||||
go da.handleMessage(c, m)
|
||||
}
|
||||
|
||||
// handleALL is the handler of all messages coming in via Diameter
|
||||
func (da *DiameterAgent) handleMessage(c diam.Conn, m *diam.Message) {
|
||||
dApp, err := m.Dictionary().App(m.Header.ApplicationID)
|
||||
|
||||
Reference in New Issue
Block a user