diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6797c00 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +log +cache + + diff --git a/cmd/main.go b/cmd/main.go index 56c69b4..2fb6de5 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -7,7 +7,6 @@ import ( "time" "github.com/go-redis/redis/v8" - "github.com/yuninks/loggerx" "github.com/yuninks/timerx" "github.com/yuninks/timerx/priority" ) @@ -128,9 +127,10 @@ func cluster() { client := getRedis() 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") fmt.Println(err) err = cluster.EverySpace(ctx, "test_space2", 2*time.Second, aa, "这是秒任务2") diff --git a/once_test.go b/once_test.go index 14e5b7c..3243778 100644 --- a/once_test.go +++ b/once_test.go @@ -1,2 +1,7 @@ package timerx +import "testing" + +func Test2(t *testing.T) { + +}