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 b15f38e commit 83109cb
Show file tree
Hide file tree
Showing 4 changed files with 6 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
4 changes: 3 additions & 1 deletion src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ const QString certPasswd() { return QStringLiteral("http_certificatePasswd"); }

QString ConfigFile::_confDir = QString();
bool ConfigFile::_askedUser = false;
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 @@ -442,8 +444,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 @@ -209,7 +209,6 @@ class OWNCLOUDSYNC_EXPORT ConfigFile

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

static bool _askedUser;
static QString _oCVersion;
Expand Down

0 comments on commit 83109cb

Please sign in to comment.