From 062a39b2092df84e189a33ce23c37e7ebe5026d7 Mon Sep 17 00:00:00 2001 From: Yun Date: Tue, 23 Sep 2025 11:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=8B.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++++ cmd/main.go | 6 +++--- once_test.go | 5 +++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .gitignore 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) { + +}