Loading server/matchmaker_process.go +20 −0 Original line number Diff line number Diff line Loading @@ -572,6 +572,26 @@ func (m *LocalMatchmaker) processCustom(activeIndexesCopy map[string]*Matchmaker // Allow the custom function to determine which of the matches should be formed. All others will be discarded. matchedEntries = m.runtime.matchmakerOverrideFunction(m.ctx, matchedEntries) var batchSize int var selectedTickets = map[string]string{} batch := bluge.NewBatch() // Mark tickets as unavailable for further use in this process iteration. for _, matchedEntry := range matchedEntries { for _, ticket := range matchedEntry { if _, found := selectedTickets[ticket.Ticket]; found { continue } selectedTickets[ticket.Ticket] = ticket.Ticket batchSize++ batch.Delete(bluge.Identifier(ticket.Ticket)) } } if batchSize > 0 { if err := m.indexWriter.Batch(batch); err != nil { m.logger.Error("error deleting matchmaker process entries batch", zap.Error(err)) } } return matchedEntries, expiredActiveIndexes } Loading server/runtime_go.go +1 −2 Original line number Diff line number Diff line Loading @@ -2498,8 +2498,7 @@ func (ri *RuntimeGoInitializer) RegisterMatchmakerOverride(fn func(ctx context.C } returnedEntries := fn(ctx, ri.logger.WithField("mode", RuntimeExecutionModeMatchmakerOverride.String()), ri.db, ri.nk, runtimeCombinations) combinations := make([][]*MatchmakerEntry, len(entries)) combinations := make([][]*MatchmakerEntry, len(returnedEntries)) for i, combination := range returnedEntries { entries := make([]*MatchmakerEntry, len(combination)) for j, entry := range combination { Loading Loading
server/matchmaker_process.go +20 −0 Original line number Diff line number Diff line Loading @@ -572,6 +572,26 @@ func (m *LocalMatchmaker) processCustom(activeIndexesCopy map[string]*Matchmaker // Allow the custom function to determine which of the matches should be formed. All others will be discarded. matchedEntries = m.runtime.matchmakerOverrideFunction(m.ctx, matchedEntries) var batchSize int var selectedTickets = map[string]string{} batch := bluge.NewBatch() // Mark tickets as unavailable for further use in this process iteration. for _, matchedEntry := range matchedEntries { for _, ticket := range matchedEntry { if _, found := selectedTickets[ticket.Ticket]; found { continue } selectedTickets[ticket.Ticket] = ticket.Ticket batchSize++ batch.Delete(bluge.Identifier(ticket.Ticket)) } } if batchSize > 0 { if err := m.indexWriter.Batch(batch); err != nil { m.logger.Error("error deleting matchmaker process entries batch", zap.Error(err)) } } return matchedEntries, expiredActiveIndexes } Loading
server/runtime_go.go +1 −2 Original line number Diff line number Diff line Loading @@ -2498,8 +2498,7 @@ func (ri *RuntimeGoInitializer) RegisterMatchmakerOverride(fn func(ctx context.C } returnedEntries := fn(ctx, ri.logger.WithField("mode", RuntimeExecutionModeMatchmakerOverride.String()), ri.db, ri.nk, runtimeCombinations) combinations := make([][]*MatchmakerEntry, len(entries)) combinations := make([][]*MatchmakerEntry, len(returnedEntries)) for i, combination := range returnedEntries { entries := make([]*MatchmakerEntry, len(combination)) for j, entry := range combination { Loading