mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 19:58:56 +03:00
Sync scheduling: Improve logging. #2275
This commit is contained in:
parent
4f2fb4af5d
commit
886f9d82f2
1 changed files with 18 additions and 3 deletions
|
@ -270,10 +270,24 @@ void Folder::slotPollTimerTimeout()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval() ||
|
bool forceSyncIntervalExpired =
|
||||||
|
quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval();
|
||||||
|
bool okSyncResult =
|
||||||
|
_syncResult.status() == SyncResult::Success ||
|
||||||
|
_syncResult.status() == SyncResult::Problem;
|
||||||
|
if (forceSyncIntervalExpired ||
|
||||||
_forceSyncOnPollTimeout ||
|
_forceSyncOnPollTimeout ||
|
||||||
!(_syncResult.status() == SyncResult::Success ||_syncResult.status() == SyncResult::Problem)) {
|
!okSyncResult) {
|
||||||
qDebug() << "** Force Sync now, state is " << _syncResult.statusString();
|
if (forceSyncIntervalExpired) {
|
||||||
|
qDebug() << "** Force Sync, because it has been " << _timeSinceLastSync.elapsed() << "ms "
|
||||||
|
<< "since the last sync";
|
||||||
|
}
|
||||||
|
if (_forceSyncOnPollTimeout) {
|
||||||
|
qDebug() << "** Force Sync, because it was requested";
|
||||||
|
}
|
||||||
|
if (!okSyncResult) {
|
||||||
|
qDebug() << "** Force Sync, because the last sync had status: " << _syncResult.statusString();
|
||||||
|
}
|
||||||
_forceSyncOnPollTimeout = false;
|
_forceSyncOnPollTimeout = false;
|
||||||
emit scheduleToSync(alias());
|
emit scheduleToSync(alias());
|
||||||
} else {
|
} else {
|
||||||
|
@ -734,6 +748,7 @@ void Folder::slotSyncFinished()
|
||||||
_timeSinceLastSync.restart();
|
_timeSinceLastSync.restart();
|
||||||
} else {
|
} else {
|
||||||
// Another sync is required. We will make sure that the poll timer occurs soon enough.
|
// Another sync is required. We will make sure that the poll timer occurs soon enough.
|
||||||
|
qDebug() << "another sync was requested by the finished sync";
|
||||||
_forceSyncOnPollTimeout = true;
|
_forceSyncOnPollTimeout = true;
|
||||||
QTimer::singleShot(1000, this, SLOT(slotPollTimerTimeout() ));
|
QTimer::singleShot(1000, this, SLOT(slotPollTimerTimeout() ));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue