-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gtimer close function is invalid #4216
Labels
bug
It is confirmed a bug, but don't worry, we'll handle it.
Comments
没有复现你说的情况 func TestIssue4216(t *testing.T) {
ctx := t.Context()
tm := New()
tm.AddOnce(ctx, 9*time.Millisecond, func(ctx context.Context) {
fmt.Println("hello")
})
time.Sleep(2 * time.Second)
tm.Close()
time.Sleep(10 * time.Second)
}
|
No recurring what you said func TestIssue4216(t *testing.T) {
ctx := t.Context()
tm := New()
tm.AddOnce(ctx, 9*time.Millisecond, func(ctx context.Context) {
fmt.Println("hello")
})
time.Sleep(2 * time.Second)
tm.Close()
time.Sleep(10 * time.Second)
}
|
抱歉上次没有说清楚 ,Timer.loop方法,在loop协程退出后,还是会打印"测试退出" 这个字符串,timker 没有退出,我没找到不退出的原因 。
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go version
go1.23
GoFrame version
2.9.0
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
tm := gtimer.New()
tm.AddOnce(ctx, time.Millisecond*9, func(ctx context.Context) {
fmt.Println("hello")
})
time.Sleep(time.Second * 2)
tm.Close()
time.Sleep(time.Second * 10)
What did you see happen?
tm的tinker 还在跑,没有退出
What did you expect to see?
tm.Close() 应该退出loop 协程吧 ,但是没有退出 。
The text was updated successfully, but these errors were encountered: