v1.0.0-rc.118 (#25)
Some checks failed
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 8m22s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 8m37s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m15s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 9m39s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 9m17s
Build Packages / Generate python client (push) Successful in 21s
Build Packages / Build documentation (push) Successful in 43s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8) (push) Successful in 7m51s
Build Packages / build:rpm (rocky9) (push) Successful in 8m45s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m55s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m22s
Build Packages / Unit tests (push) Failing after 1h5m51s
Some checks failed
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 8m22s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 8m37s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m15s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 9m39s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 9m17s
Build Packages / Generate python client (push) Successful in 21s
Build Packages / Build documentation (push) Successful in 43s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8) (push) Successful in 7m51s
Build Packages / build:rpm (rocky9) (push) Successful in 8m45s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m55s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m22s
Build Packages / Unit tests (push) Failing after 1h5m51s
This is an UNSTABLE release and not recommended for production use (please use rc.111 instead). * jfjoch_viewer: Fix issue when HTTP sync silently disconnected when it was enabled when the broker was starting measurement. * jfjoch_broker: Add protections on time of geometry optimization and reduce rotation recalculations Reviewed-on: #25 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch> Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #25.
This commit is contained in:
@@ -10,15 +10,10 @@
|
||||
#include "../broker/gen/model/Plots.h"
|
||||
#include "../image_analysis/bragg_integration/CalcISigma.h"
|
||||
|
||||
void JFJochHttpReader::Close_i() {
|
||||
addr = "";
|
||||
SetStartMessage({});
|
||||
|
||||
}
|
||||
|
||||
void JFJochHttpReader::Close() {
|
||||
std::unique_lock ul(http_mutex);
|
||||
Close_i();
|
||||
addr = "";
|
||||
SetStartMessage({});
|
||||
}
|
||||
|
||||
uint64_t JFJochHttpReader::GetNumberOfImages() const {
|
||||
@@ -43,14 +38,21 @@ uint64_t JFJochHttpReader::GetNumberOfImages() const {
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<JFJochReaderDataset> JFJochHttpReader::UpdateDataset_i() {
|
||||
std::shared_ptr<JFJochReaderDataset> JFJochHttpReader::UpdateDataset_i() {
|
||||
httplib::Client cli_cmd(addr);
|
||||
|
||||
auto res = cli_cmd.Get("/image_buffer/start.cbor");
|
||||
|
||||
if (!res || res->status != httplib::StatusCode::OK_200)
|
||||
if (!res || (res->status != httplib::StatusCode::OK_200
|
||||
&& res->status != httplib::StatusCode::NotFound_404))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Could not get image buffer status");
|
||||
|
||||
if (res->status == httplib::StatusCode::NotFound_404)
|
||||
return {};
|
||||
if (res->body.empty())
|
||||
return {};
|
||||
|
||||
try {
|
||||
auto msg = CBORStream2Deserialize(res->body);
|
||||
|
||||
@@ -125,19 +127,18 @@ std::shared_ptr<JFJochReaderDataset> JFJochHttpReader::UpdateDataset_i() {
|
||||
|
||||
return dataset;
|
||||
} catch (std::exception &e) {
|
||||
Close_i();
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Could not load dataset");
|
||||
std::string("Could not load dataset: ") + std::string(e.what()));
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochHttpReader::ReadURL(const std::string &url) {
|
||||
std::unique_lock ul(http_mutex);
|
||||
|
||||
addr = url;
|
||||
if (url.empty())
|
||||
Close_i();
|
||||
SetStartMessage(UpdateDataset_i());
|
||||
SetStartMessage({});
|
||||
else
|
||||
SetStartMessage(UpdateDataset_i());
|
||||
}
|
||||
|
||||
bool JFJochHttpReader::LoadImage_i(std::shared_ptr<JFJochReaderDataset> &dataset,
|
||||
@@ -155,6 +156,8 @@ bool JFJochHttpReader::LoadImage_i(std::shared_ptr<JFJochReaderDataset> &dataset
|
||||
// Always update dataset, as it might have changed from the last time
|
||||
if (update_dataset)
|
||||
dataset = UpdateDataset_i();
|
||||
if (!dataset)
|
||||
return false;
|
||||
|
||||
auto res = cli_cmd.Get("/image_buffer/image.cbor?id=" + std::to_string(image_number));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user