diff --git a/core_test.go b/core_test.go index 3075317..dc73705 100644 --- a/core_test.go +++ b/core_test.go @@ -23,7 +23,7 @@ var tw *TimeWheel // // Date : 17:00 2023/8/11 func TestNewTimeWheel(t *testing.T) { - tw = NewTimeWheel(10, 10*time.Second) + tw = NewTimeWheel(10, time.Second) tw.AddTask(&Task{ Key: wrapper.StringFromRandom(32, "").Value(), Interval: 5 * time.Second, @@ -36,8 +36,7 @@ func TestNewTimeWheel(t *testing.T) { }, false) go tw.Start() time.Sleep(3 * time.Second) - for tw.IsRunning { - + for tw.isRunning { } } @@ -61,7 +60,7 @@ func (t testTask) Callback(result *Result) error { return nil } -func (t testTask) Execute(ctx context.Context, cfg *Config) (map[string]any, error) { +func (t testTask) Execute(ctx context.Context, cfg *Config) *Result { fmt.Println(wrapper.OwnTimeFromNow().ToString()) - return nil, nil + return nil }