Skip to content

Commit d353850

Browse files
nyalldawsonrldhont
authored andcommittedMay 21, 2020
Timeout for blocking network requests in content cache should match
the user's preset network timeout value, not a hardcoded value
1 parent c52a0ba commit d353850

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/core/qgsabstractcontentcache.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ class CORE_EXPORT QgsAbstractContentCache : public QgsAbstractContentCacheBase
447447
}
448448

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

0 commit comments

Comments
 (0)
Please sign in to comment.