优化代码

This commit is contained in:
GoEdgeLab
2023-10-11 07:24:02 +08:00
parent 0059a79bb2
commit ceb0c31cd0

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 {