|
|
@ -15,7 +15,7 @@ RequestRepeater::RequestRepeater(QObject *parent, const QString &requestURL, con |
|
|
|
if (!cacheKey.isEmpty()) { |
|
|
|
if (!cacheKey.isEmpty()) { |
|
|
|
prevResp = QString::fromStdString(params.get(cacheKey.toStdString())); |
|
|
|
prevResp = QString::fromStdString(params.get(cacheKey.toStdString())); |
|
|
|
if (!prevResp.isEmpty()) { |
|
|
|
if (!prevResp.isEmpty()) { |
|
|
|
QTimer::singleShot(0, [=]() { emit receivedResponse(prevResp); }); |
|
|
|
QTimer::singleShot(500, [=]() { emit receivedResponse(prevResp); }); |
|
|
|
} |
|
|
|
} |
|
|
|
QObject::connect(this, &HttpRequest::receivedResponse, [=](const QString &resp) { |
|
|
|
QObject::connect(this, &HttpRequest::receivedResponse, [=](const QString &resp) { |
|
|
|
if (resp != prevResp) { |
|
|
|
if (resp != prevResp) { |
|
|
@ -23,11 +23,5 @@ RequestRepeater::RequestRepeater(QObject *parent, const QString &requestURL, con |
|
|
|
prevResp = resp; |
|
|
|
prevResp = resp; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
QObject::connect(this, &HttpRequest::failedResponse, [=](const QString &err) { |
|
|
|
|
|
|
|
if (!prevResp.isEmpty()) { |
|
|
|
|
|
|
|
params.remove(cacheKey.toStdString()); |
|
|
|
|
|
|
|
prevResp = ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|