wsd: saving timeout set to 4x loading-time
And dump the saving timeout in the state dump. Change-Id: If203d5434ee17f646009ee241b8484ca597840ad Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This commit is contained in:
parent
c3b9cb6cab
commit
84f4267caf
2 changed files with 8 additions and 3 deletions
|
@ -1826,10 +1826,11 @@ void DocumentBroker::setLoaded()
|
|||
_docState.setLive();
|
||||
_loadDuration = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _threadStart);
|
||||
const auto minTimeoutSecs = ((_loadDuration * 4).count() + 500) / 1000;
|
||||
_saveManager.setSavingTimeout(
|
||||
std::max(std::chrono::seconds(((_loadDuration * 2).count() + 500) / 1000),
|
||||
std::chrono::seconds(5)));
|
||||
LOG_TRC("Document loaded in " << _loadDuration);
|
||||
std::max(std::chrono::seconds(minTimeoutSecs), std::chrono::seconds(5)));
|
||||
LOG_TRC("Document loaded in " << _loadDuration << ", saving-timeout set to "
|
||||
<< _saveManager.getSavingTimeout());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -871,6 +871,9 @@ private:
|
|||
_savingTimeout = savingTimeout;
|
||||
}
|
||||
|
||||
/// Get the maximum time to wait for saving to finish.
|
||||
std::chrono::seconds getSavingTimeout() const { return _savingTimeout; }
|
||||
|
||||
/// True iff the last save request has timed out.
|
||||
bool hasSavingTimedOut() const
|
||||
{
|
||||
|
@ -916,6 +919,7 @@ private:
|
|||
|
||||
os << indent
|
||||
<< "file last modified time: " << Util::getTimeForLog(now, _lastModifiedTime);
|
||||
os << indent << "saving-timeout: " << getSavingTimeout();
|
||||
os << indent << "last save timed-out: " << std::boolalpha << hasSavingTimedOut();
|
||||
os << indent << "last save successful: " << lastSaveSuccessful();
|
||||
os << indent << "save failure count: " << saveFailureCount();
|
||||
|
|
Loading…
Reference in a new issue