mirror of https://github.com/Hilbis/Hilbish
fix: stop interval if error occurs
parent
f6aaf85cca
commit
9261253b63
4
lua.go
4
lua.go
|
@ -201,8 +201,8 @@ func hshinterval(L *lua.LState) int {
|
||||||
NRet: 0,
|
NRet: 0,
|
||||||
Protect: true,
|
Protect: true,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
fmt.Fprintln(os.Stderr,
|
fmt.Fprintln(os.Stderr, "Error in interval function:\n\n", err)
|
||||||
"Error in interval function:\n\n", err)
|
stop <- lua.LTrue // stop the interval
|
||||||
}
|
}
|
||||||
case <-stop:
|
case <-stop:
|
||||||
ticker.Stop()
|
ticker.Stop()
|
||||||
|
|
Loading…
Reference in New Issue