Closed lll-lll-lll-lll closed 1 year ago
The current implementation in the Client.Run method passes zero to the interval argument of the Wait method https://github.com/replicate/replicate-go/blob/d6f3d9a0308e6b1481784631932d4f7652e7ee36/run.go#L33
This cause panic when initializing time.NewTicker. https://github.com/replicate/replicate-go/blob/d6f3d9a0308e6b1481784631932d4f7652e7ee36/prediction.go#L103
Because time.NewTicker panics when its argument is a value less than or equal to zero.
func NewTicker(d Duration) *Ticker { if d <= 0 { panic(errors.New("non-positive interval for NewTicker")) }
tim.NewTicker()
@lll-lll-lll-lll Thanks again for your help. This change is now available in v0.4.1.
@mattt thank you for your review and update my PR
What's Problem
The current implementation in the Client.Run method passes zero to the interval argument of the Wait method https://github.com/replicate/replicate-go/blob/d6f3d9a0308e6b1481784631932d4f7652e7ee36/run.go#L33
This cause panic when initializing time.NewTicker. https://github.com/replicate/replicate-go/blob/d6f3d9a0308e6b1481784631932d4f7652e7ee36/prediction.go#L103
Because time.NewTicker panics when its argument is a value less than or equal to zero.
tim.NewTicker()
What I did