diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-03-21 19:01:35 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-03-25 17:20:04 +0900 |
commit | 0e00f6f74041a5fec528d1511095ea4974150239 (patch) | |
tree | b058caeecea75ce5f0e0f199c7328973c3df4da4 /connection.cpp | |
parent | 57980b04c1a9d8bde974683fbae892580aee7466 (diff) | |
download | libquotient-0e00f6f74041a5fec528d1511095ea4974150239.tar.gz libquotient-0e00f6f74041a5fec528d1511095ea4974150239.zip |
Jobs retry on network and timeout errors
As of now, the retry logic (see BaseJob::finishJob() method) invokes the same network request several times with increasing timeouts and retry intervals. Some additional signals and accessors are also provided to control the behaviour from inheriting classes (see a notable example with SyncJob in the same commit) and clients (support of retries in Quaternion comes in a respective commit shortly).
Diffstat (limited to 'connection.cpp')
-rw-r--r-- | connection.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/connection.cpp b/connection.cpp index 2fbcf686..a9b9a534 100644 --- a/connection.cpp +++ b/connection.cpp @@ -270,6 +270,16 @@ QString Connection::accessToken() const return d->data->accessToken(); } +SyncJob* Connection::syncJob() const +{ + return d->syncJob; +} + +int Connection::millisToReconnect() const +{ + return d->syncJob ? d->syncJob->millisToRetry() : 0; +} + QHash< QString, Room* > Connection::roomMap() const { return d->roomMap; |