Skip to content

Commit

Permalink
Again considering more review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dragotin committed Aug 6, 2021
1 parent b7b1ffb commit 3a4bcf9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog/unreleased/8780
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Enhancement: Consider a remote poll interval coming with the server capabilities
This way, admins can configure the remote sync poll interval of clients through
the capabilities settings of the server. Note that the setting in the server
capabilities needs to be done in milliseconds. Default is 30 seconds.

https://github.com/owncloud/client/issues/5947
https://github.com/owncloud/client/issues/8780
https://github.com/owncloud/client/pull/8777
4 changes: 2 additions & 2 deletions src/libsync/capabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class OWNCLOUDSYNC_EXPORT Capabilities
bool shareResharing() const;
/** Remote Poll interval.
*
* returns the requested poll interval to be used by the client in milliseconds.
* If it returns -1 the client default remains unchanged.
* returns the requested poll interval in seconds to be used by the client.
* @returns 0 if no capability is set.
*/
std::chrono::seconds remotePollInterval() const;

Expand Down
3 changes: 2 additions & 1 deletion src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const QString moveToTrashC() { return QStringLiteral("moveToTrash"); }
}

QString ConfigFile::_confDir = QString();
const std::chrono::seconds DefaultRemotePollInterval { 30 }; // default remote poll time in milliseconds

static chrono::milliseconds millisecondsValue(const QSettings &setting, const QString &key,
chrono::milliseconds defaultValue)
Expand Down Expand Up @@ -427,8 +428,8 @@ chrono::milliseconds ConfigFile::remotePollInterval(std::chrono::seconds default
}
auto remoteInterval = millisecondsValue(settings, remotePollIntervalC(), defaultPollInterval);
if (remoteInterval < chrono::seconds(5)) {
qCWarning(lcConfigFile) << "Remote Interval is less than 5 seconds, reverting to" << DefaultRemotePollInterval.count();
remoteInterval = defaultPollInterval;
qCWarning(lcConfigFile) << "Remote Interval is less than 5 seconds, reverting to" << remoteInterval.count();
}
return remoteInterval;
}
Expand Down
1 change: 0 additions & 1 deletion src/libsync/configfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ class OWNCLOUDSYNC_EXPORT ConfigFile

private:
typedef QSharedPointer<AbstractCredentials> SharedCreds;
const std::chrono::seconds DefaultRemotePollInterval { 30 }; // default remote poll time in milliseconds

static QString _oCVersion;
static QString _confDir;
Expand Down

0 comments on commit 3a4bcf9

Please sign in to comment.