优化代码

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
)
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 {