优化代码

This commit is contained in:
刘祥超
2023-10-11 07:24:02 +08:00
parent 7f3e6ddc65
commit 8449fe7c0b

View File

@@ -22,13 +22,15 @@ const (
maxMemoryFragmentPoolItemAgeSeconds = 60
)
var SharedFragmentMemoryPool = NewMemoryFragmentPool()
var SharedFragmentMemoryPool *MemoryFragmentPool
func init() {
if !teaconst.IsMain {
return
}
SharedFragmentMemoryPool = NewMemoryFragmentPool()
goman.New(func() {
var ticker = time.NewTicker(200 * time.Millisecond)
for range ticker.C {