diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2022-03-06 13:07:47 -0500 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-03-16 15:50:26 +0100 |
commit | 24006086a5e20ee39bf017d0bfdab5c22009c59a (patch) | |
tree | 3f9500282c0645df1c6b26d35110282e49661e98 /wsd/DocumentBroker.cpp | |
parent | wsd: wait longer when restarting forkit (diff) | |
download | online-24006086a5e20ee39bf017d0bfdab5c22009c59a.tar.gz online-24006086a5e20ee39bf017d0bfdab5c22009c59a.zip |
wsd: stop loading when low on disk space
For some reason the disk-space check wasn't
done for WOPI storage. Here we add the check
and bubble the exception up to stop loading.
UnitStorage has been updated and re-enabled.
Change-Id: I15a093554b662d6c0828da7683ca0190a8225fc9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Diffstat (limited to 'wsd/DocumentBroker.cpp')
-rw-r--r-- | wsd/DocumentBroker.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index 604f80b2cf..1e30517354 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -890,6 +890,10 @@ bool DocumentBroker::download(const std::shared_ptr<ClientSession>& session, con std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now(); std::string localPath = _storage->downloadStorageFileToLocal(session->getAuthorization(), *_lockCtx, templateSource); + if (localPath.empty()) + { + throw std::runtime_error("Failed to retrieve document from storage"); + } getFileCallDurationMs = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::steady_clock::now() - start); |