From ca51b3865fa360a7a9b69a0748ee92033ac9520c Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 22 Jul 2021 22:14:32 -0700 Subject: [PATCH] Fix RequestRepeater caching (#21693) * Fix RequestRepeater caching * cleanup Co-authored-by: Comma Device --- selfdrive/ui/qt/request_repeater.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/selfdrive/ui/qt/request_repeater.cc b/selfdrive/ui/qt/request_repeater.cc index 7c11c0f8a4..959d7eff00 100644 --- a/selfdrive/ui/qt/request_repeater.cc +++ b/selfdrive/ui/qt/request_repeater.cc @@ -15,7 +15,7 @@ RequestRepeater::RequestRepeater(QObject *parent, const QString &requestURL, con if (!cacheKey.isEmpty()) { prevResp = QString::fromStdString(params.get(cacheKey.toStdString())); if (!prevResp.isEmpty()) { - QTimer::singleShot(0, [=]() { emit receivedResponse(prevResp); }); + QTimer::singleShot(500, [=]() { emit receivedResponse(prevResp); }); } QObject::connect(this, &HttpRequest::receivedResponse, [=](const QString &resp) { if (resp != prevResp) { @@ -23,11 +23,5 @@ RequestRepeater::RequestRepeater(QObject *parent, const QString &requestURL, con prevResp = resp; } }); - QObject::connect(this, &HttpRequest::failedResponse, [=](const QString &err) { - if (!prevResp.isEmpty()) { - params.remove(cacheKey.toStdString()); - prevResp = ""; - } - }); } }