diff --git a/src/blackcore/db/databasewriter.cpp b/src/blackcore/db/databasewriter.cpp index 789964084..67129037e 100644 --- a/src/blackcore/db/databasewriter.cpp +++ b/src/blackcore/db/databasewriter.cpp @@ -87,7 +87,8 @@ namespace BlackCore if (compress) { url.setQuery(CDatabaseUtils::getCompressedQuery()); } QNetworkRequest request(url); CNetworkUtils::ignoreSslVerification(request); - m_pendingReply = sApp->postToNetwork(request, multiPart, { this, &CDatabaseWriter::ps_postModelsResponse}); + int logId = m_writeLog.addPendingUrl(url); + m_pendingReply = sApp->postToNetwork(request, logId, multiPart, { this, &CDatabaseWriter::ps_postModelsResponse}); m_replyPendingSince = QDateTime::currentMSecsSinceEpoch(); return msgs; } @@ -98,6 +99,12 @@ namespace BlackCore this->killPendingReply(); } + const QString &CDatabaseWriter::getName() + { + static const QString n("Database writer"); + return n; + } + void CDatabaseWriter::ps_postModelsResponse(QNetworkReply *nwReplyPtr) { static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::swiftDbWebservice()})); diff --git a/src/blackcore/db/databasewriter.h b/src/blackcore/db/databasewriter.h index e99140c6b..e0fd653b0 100644 --- a/src/blackcore/db/databasewriter.h +++ b/src/blackcore/db/databasewriter.h @@ -14,6 +14,7 @@ #include "blackcore/blackcoreexport.h" #include "blackmisc/network/url.h" +#include "blackmisc/network/urlloglist.h" #include "blackmisc/simulation/aircraftmodellist.h" #include "blackmisc/statusmessagelist.h" @@ -48,6 +49,12 @@ namespace BlackCore //! Shutting down? bool isShuttingDown() const { return m_shutdown; } + //! Name of the worker + const QString &getName(); + + //! Write log + const BlackMisc::Network::CUrlLogList &getWriteLog() const { return m_writeLog; } + signals: //! Published models, the response to \sa asyncPublishModels void publishedModels(const BlackMisc::Simulation::CAircraftModelList &modelsPublished, @@ -60,6 +67,7 @@ namespace BlackCore void ps_postModelsResponse(QNetworkReply *nwReplyPtr); private: + BlackMisc::Network::CUrlLogList m_writeLog; BlackMisc::Network::CUrl m_modelPublishUrl; QNetworkReply *m_pendingReply = nullptr; qint64 m_replyPendingSince = -1;