Commit 24f71827 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Add debug information when a backend is being slow

This can help us detect what's wrong whenever a backend gets stuck,
which seems to happen every now and then.
parent 80bdde1a
......@@ -72,6 +72,18 @@ void ResultsStream::finish()
AbstractResourcesBackend::AbstractResourcesBackend(QObject* parent)
: QObject(parent)
{
QTimer* fetchingChangedTimer = new QTimer(this);
fetchingChangedTimer->setInterval(3000);
fetchingChangedTimer->setSingleShot(true);
connect(fetchingChangedTimer, &QTimer::timeout, this, [this]{ qDebug() << "took really long to fetch" << this; });
connect(this, &AbstractResourcesBackend::fetchingChanged, this, [this, fetchingChangedTimer]{
// Q_ASSERT(isFetching() != fetchingChangedTimer->isActive());
if (isFetching())
fetchingChangedTimer->start();
else
fetchingChangedTimer->stop();
});
}
Transaction* AbstractResourcesBackend::installApplication(AbstractResource* app)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment