添加一下.gitignore
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
log
|
||||||
|
cache
|
||||||
|
|
||||||
|
|
||||||
+3
-3
@@ -7,7 +7,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/go-redis/redis/v8"
|
||||||
"github.com/yuninks/loggerx"
|
|
||||||
"github.com/yuninks/timerx"
|
"github.com/yuninks/timerx"
|
||||||
"github.com/yuninks/timerx/priority"
|
"github.com/yuninks/timerx/priority"
|
||||||
)
|
)
|
||||||
@@ -128,9 +127,10 @@ func cluster() {
|
|||||||
client := getRedis()
|
client := getRedis()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
log := loggerx.NewLogger(ctx,loggerx.SetToConsole(),loggerx.SetEscapeHTML(false))
|
// log := loggerx.NewLogger(ctx,loggerx.SetToConsole(),loggerx.SetEscapeHTML(false))
|
||||||
|
// _ = log
|
||||||
|
|
||||||
cluster := timerx.InitCluster(ctx, client, "test", timerx.SetPriority(103), timerx.SetLogger(log))
|
cluster := timerx.InitCluster(ctx, client, "test", timerx.SetPriority(103))
|
||||||
err := cluster.EverySpace(ctx, "test_space1", 1*time.Second, aa, "这是秒任务1")
|
err := cluster.EverySpace(ctx, "test_space1", 1*time.Second, aa, "这是秒任务1")
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
err = cluster.EverySpace(ctx, "test_space2", 2*time.Second, aa, "这是秒任务2")
|
err = cluster.EverySpace(ctx, "test_space2", 2*time.Second, aa, "这是秒任务2")
|
||||||
|
|||||||
@@ -1,2 +1,7 @@
|
|||||||
package timerx
|
package timerx
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func Test2(t *testing.T) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user