支持自动转换图像文件为WebP

This commit is contained in:
GoEdgeLab
2021-10-01 16:24:17 +08:00
parent ce9541ef8b
commit 300c11041f
5 changed files with 124 additions and 46 deletions

View File

@@ -1,7 +1,6 @@
package utils
import (
"github.com/iwind/TeaGo/logs"
"sync"
"testing"
"time"
@@ -14,7 +13,7 @@ func TestTicker(t *testing.T) {
ticker.Stop()
}()
for ticker.Next() {
logs.Println("tick")
t.Log("tick")
}
t.Log("finished")
}
@@ -26,10 +25,10 @@ func TestTicker2(t *testing.T) {
ticker.Stop()
}()
for {
logs.Println("loop")
t.Log("loop")
select {
case <-ticker.C:
logs.Println("tick")
t.Log("tick")
case <-ticker.S:
return
}
@@ -42,7 +41,7 @@ func TestTickerEvery(t *testing.T) {
wg.Add(1)
Every(2*time.Second, func(ticker *Ticker) {
i++
logs.Println("TestTickerEvery i:", i)
t.Log("TestTickerEvery i:", i)
if i >= 4 {
ticker.Stop()
wg.Done()