```
refactor(socket): 使用fmt.Println替换Logger.Error处理panic 修复socket连接关闭和流量处理中的panic恢复机制, 使用fmt.Println直接打印错误信息替代原有的Logger组件。 --- refactor(timer): 移除ants协程池依赖并优化错误处理 移除timer模块中对ants协程池的依赖,改用原生goroutine, 添加panic恢复机制确保任务执行的稳定性。 --- feat(player): 移除CountPlayer函数 删除玩家服务中统计在线玩家数量的功能函数, 该功能不再需要由专门函数提供。 --- refactor(space): 移除协程池优化广播逻辑 移除空间服务中对ants协程池的依赖,简化广播逻辑, 将用户循环遍历操作改为同步执行以提升性能。 ```
This commit is contained in:
@@ -16,7 +16,6 @@ type CsMap[K comparable, V any] struct {
|
||||
shards []shard[K, V]
|
||||
shardCount uint64
|
||||
size uint64
|
||||
//pool *ants.Pool
|
||||
}
|
||||
|
||||
type HashShardPair[K comparable, V any] struct {
|
||||
@@ -47,7 +46,7 @@ func New[K comparable, V any](options ...OptFunc[K, V]) *CsMap[K, V] {
|
||||
for i := 0; i < int(m.shardCount); i++ {
|
||||
m.shards[i] = shard[K, V]{items: swiss.NewMap[K, V](uint32((m.size / m.shardCount) + 1)), RWMutex: &sync.RWMutex{}}
|
||||
}
|
||||
//m.pool, _ = ants.NewPool(-1)
|
||||
|
||||
return &m
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user