mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add cancellation of well path collection loading.
This commit is contained in:
@@ -762,6 +762,9 @@ void RiaOsduConnector::requestParquetData( const QString& url, const QString& da
|
||||
RiaLogging::info( "Requesting download of parquet from: " + url );
|
||||
|
||||
auto reply = makeDownloadRequest( url, dataPartitionId, token, RiaCloudDefines::contentTypeParquet() );
|
||||
m_repliesMutex.lock();
|
||||
m_replies[id] = reply;
|
||||
m_repliesMutex.unlock();
|
||||
|
||||
connect( reply,
|
||||
&QNetworkReply::finished,
|
||||
@@ -792,3 +795,19 @@ void RiaOsduConnector::parquetDownloadComplete( const QByteArray& contents, cons
|
||||
m_parquetData[id] = contents;
|
||||
m_parquetErrors[id] = errorMessage;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaOsduConnector::cancelRequestForId( const QString& id )
|
||||
{
|
||||
QMutexLocker lock( &m_repliesMutex );
|
||||
auto it = m_replies.find( id );
|
||||
if ( it != m_replies.end() )
|
||||
{
|
||||
if ( !it->second.isNull() )
|
||||
{
|
||||
it->second->abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +113,8 @@ public:
|
||||
|
||||
QString wellIdForWellboreId( const QString& wellboreId ) const;
|
||||
|
||||
void cancelRequestForId( const QString& id );
|
||||
|
||||
void clearCachedData();
|
||||
|
||||
QString dataPartition() const;
|
||||
@@ -173,6 +175,7 @@ private:
|
||||
const QString m_dataPartitionId;
|
||||
|
||||
mutable QMutex m_mutex;
|
||||
mutable QMutex m_repliesMutex;
|
||||
std::vector<OsduField> m_fields;
|
||||
std::vector<OsduWell> m_wells;
|
||||
std::map<QString, std::vector<OsduWellbore>> m_wellbores;
|
||||
@@ -180,4 +183,5 @@ private:
|
||||
std::map<QString, std::vector<OsduWellLog>> m_wellLogs;
|
||||
std::map<QString, QByteArray> m_parquetData;
|
||||
std::map<QString, QString> m_parquetErrors;
|
||||
std::map<QString, QPointer<QNetworkReply>> m_replies;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user