Skip to content
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

Panic: non-positive interval for NewTicker #34

Closed
sybrandy opened this issue May 4, 2017 · 3 comments
Closed

Panic: non-positive interval for NewTicker #34

sybrandy opened this issue May 4, 2017 · 3 comments

Comments

@sybrandy
Copy link

sybrandy commented May 4, 2017

I don't know why this occurred, but I got this error during one of my test runs:

panic: non-positive interval for NewTicker
time.NewTicker
    go/src/time/tick.go:32
github.com/gmallard/stompngo.(*Connection).receiveTicker
    src/github.com/gmallard/stompngo/heartbeats.go:163
github.com/gmallard/stompngo.(*Connection).initializeHeartBeats
    src/github.com/gmallard/stompngo/heartbeats.go:183

It only happened to me once, so it's probably something transient. Just wanted to report it as this seems like something that would be very simple to check for so that it's prevented in the future.

@gmallard
Copy link
Owner

gmallard commented May 5, 2017

Bizarre. Was the ticker at 500ms ?

I can see how it could happen. I will make that code a bit more defensive.

@gmallard
Copy link
Owner

gmallard commented May 5, 2017

On DEV: 7c54f33

@sybrandy
Copy link
Author

sybrandy commented May 5, 2017

Honestly, I don't recall. I waited until I was done testing to file the bug as I was focused on trying to figure out other issues.

The fix, however, looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants