优化代码

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 maxMemoryFragmentPoolItemAgeSeconds = 60
) )
var SharedFragmentMemoryPool = NewMemoryFragmentPool() var SharedFragmentMemoryPool *MemoryFragmentPool
func init() { func init() {
if !teaconst.IsMain { if !teaconst.IsMain {
return return
} }
SharedFragmentMemoryPool = NewMemoryFragmentPool()
goman.New(func() { goman.New(func() {
var ticker = time.NewTicker(200 * time.Millisecond) var ticker = time.NewTicker(200 * time.Millisecond)
for range ticker.C { for range ticker.C {