warden-stack/Warden

WebWatcher behavior

aeb-dev opened this issue · 0 comments

I'm not sure how this should behave but when I use WebWatcherConfiguration with WithTimeout, the watcher result is valid only on first iteration. However, if I use WithHttpServiceProvider it is okay.

WebWatcherConfiguration configuration = WebWatcherConfiguration
                .Create("http://localhost:5000")
                //.WithHttpServiceProvider(() => new HttpService(new HttpClient() { Timeout = TimeSpan.FromSeconds(1) }))
                .WithRequest(HttpRequest.Get("v1/health-check"))
                // .WithTimeout(TimeSpan.FromSeconds(1))
                .EnsureThat(response => response.Data == "OK")
                .Build();

Is it normal behavior or am I doing something wrong?
The warden is initialized and started at startup.