执行定时任务时自动根据负载进行延后执行

This commit is contained in:
GoEdgeLab
2024-04-12 21:13:19 +08:00
parent ca43d119e4
commit 35c57bf070
8 changed files with 35 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ import (
fsutils "github.com/TeaOSLab/EdgeNode/internal/utils/fs"
"github.com/iwind/TeaGo/assert"
"testing"
"time"
)
func TestWrites(t *testing.T) {
@@ -20,6 +21,10 @@ func TestWrites(t *testing.T) {
a.IsTrue(fsutils.WriteReady())
}
func TestWaitLoad(t *testing.T) {
fsutils.WaitLoad(100, 1, 1 * time.Minute)
}
func BenchmarkWrites(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {