Panic when trying to use RefreshOptions.Then with mode ASYNC

This doesn't work, and since it took me a while of debugging to figure this out,
alert other developers earlier when they try to do it.
This commit is contained in:
Stefan Haller 2023-08-22 13:55:05 +02:00
parent 93d19db158
commit d74c817fd8

View file

@ -51,6 +51,10 @@ func NewRefreshHelper(
}
func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
if options.Mode == types.ASYNC && options.Then != nil {
panic("RefreshOptions.Then doesn't work with mode ASYNC")
}
t := time.Now()
defer func() {
self.c.Log.Infof(fmt.Sprintf("Refresh took %s", time.Since(t)))