FIx unit test by reverting to old fetch code

This commit is contained in:
Lee *!* Clagett 2024-02-19 15:49:11 -05:00
parent 87070eab25
commit 76dca3bc34

View file

@ -1072,11 +1072,20 @@ namespace lws
return sent.error();
}
auto resp = client.get_message(sync_rpc_timeout);
if (!scanner::is_running())
return {lws::error::signal_abort_process};
if (!resp)
return resp.error();
expect<std::string> resp{lws::error::daemon_timeout};
start = std::chrono::steady_clock::now();
while (!(resp = client.get_message(std::chrono::seconds{1})))
{
if (!scanner::is_running())
return {lws::error::signal_abort_process};
if (sync_rpc_timeout <= (std::chrono::steady_clock::now() - start))
return {lws::error::daemon_timeout};
if (!resp.matches(std::errc::timed_out))
return resp.error();
}
return rpc::parse_json_response<R>(std::move(*resp));
}