Skip to content

Commit

Permalink
fix room sorting servers
Browse files Browse the repository at this point in the history
  • Loading branch information
temur abdurahmanov committed Jan 9, 2025
1 parent a784d0a commit 673bd19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions internal/service/dev_tools/connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ func (c *connections) GetRoomsConnectionUrls(ctx context.Context, token string)
}

for _, server := range uniqueServers {
if _, ok := uniqueServerType[server.ServerType]; ok {
continue
}

connNum, exists, err := server.GetConnectionsNum(ctx, token)
if err != nil {
c.logger.Error().Err(err).Msg("server error create room")
Expand All @@ -258,10 +262,6 @@ func (c *connections) GetRoomsConnectionUrls(ctx context.Context, token string)
continue
}

if _, ok := uniqueServerType[server.ServerType]; ok {
continue
}

err = server.CreateRoom(ctx, token, time.Duration(time.Minute*10))
if err != nil {
if err.Error() != errors.ErrRoomIsExists.Error() {
Expand Down
2 changes: 1 addition & 1 deletion internal/start/multiplatform.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func Multiplayer(logger zerolog.Logger) {
devToolsServerService := devtools.NewServerService(accessGameService, gameStorage, serverStorage, token, &logger)
devToolsGameConfigs := devtools.NewGameConfigs(accessGameService, gameConfigStorage, token, &logger)

go connectionsScheduler.RoomCleaner(context.Background(), time.Minute*15, 300)
go connectionsScheduler.RoomCleaner(context.Background(), time.Minute*15, 0)

services := []transport.Option{
transport.MaxBodySize(10 * 1024 * 1024),
Expand Down

0 comments on commit 673bd19

Please sign in to comment.