Device: Add mutex for disk info requests to temporarily work around WiVIClient timeout issues
parent
c2de1dfdf1
commit
44ad06d4bb
|
|
@ -528,6 +528,9 @@ optional<bool> Device::isLogicalDiskConnected() {
|
||||||
return nullopt;
|
return nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This doesn't *really* make sense here but because the disk read redirects the parser until it is done, we'll lock this
|
||||||
|
// just to avoid the timeout.
|
||||||
|
std::lock_guard<std::mutex> lg(diskLock);
|
||||||
const auto info = com->getLogicalDiskInfoSync();
|
const auto info = com->getLogicalDiskInfoSync();
|
||||||
if (!info) {
|
if (!info) {
|
||||||
report(APIEvent::Type::Timeout, APIEvent::Severity::Error);
|
report(APIEvent::Type::Timeout, APIEvent::Severity::Error);
|
||||||
|
|
@ -543,6 +546,9 @@ optional<uint64_t> Device::getLogicalDiskSize() {
|
||||||
return nullopt;
|
return nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This doesn't *really* make sense here but because the disk read redirects the parser until it is done, we'll lock this
|
||||||
|
// just to avoid the timeout.
|
||||||
|
std::lock_guard<std::mutex> lg(diskLock);
|
||||||
const auto info = com->getLogicalDiskInfoSync();
|
const auto info = com->getLogicalDiskInfoSync();
|
||||||
if (!info) {
|
if (!info) {
|
||||||
report(APIEvent::Type::Timeout, APIEvent::Severity::Error);
|
report(APIEvent::Type::Timeout, APIEvent::Severity::Error);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue