Skip to content
Permalink
Browse files

Timeout for blocking network requests in content cache should match

the user's preset network timeout value, not a hardcoded value
  • Loading branch information
nyalldawson committed Mar 18, 2020
1 parent e6344c1 commit f822bd63a4e9ad164d0f305559f5db87070a8b68
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/qgsabstractcontentcache.h
@@ -447,7 +447,7 @@ class CORE_EXPORT QgsAbstractContentCache : public QgsAbstractContentCacheBase
}

/**
* Blocks the current thread until the \a task finishes or an arbitrary setting maximum wait to 5 seconds
* Blocks the current thread until the \a task finishes (or user's preset network timeout expires)
*
* \warning this method must NEVER be used from GUI based applications (like the main QGIS application)
* or crashes will result. Only for use in external scripts or QGIS server.
@@ -458,8 +458,8 @@ class CORE_EXPORT QgsAbstractContentCache : public QgsAbstractContentCacheBase
*/
bool waitForTaskFinished( QgsNetworkContentFetcherTask *task ) const
{
// Second step, wait 5 seconds for task finished
if ( task->waitForFinished( 5000 ) )
// Wait up to timeout seconds for task finished
if ( task->waitForFinished( QgsNetworkAccessManager::timeout() ) )
{
// The wait did not time out
// Third step, check status as complete

0 comments on commit f822bd6

Please sign in to comment.
You can’t perform that action at this time.