Skip to content

Commit

Permalink
Make expression functions that use internal requests more stable
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 2, 2018
1 parent 14643ad commit 5252bf1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -3569,6 +3569,8 @@ static QVariant fcnGetFeatureById( const QVariantList &values, const QgsExpressi

QgsFeatureRequest req;
req.setFilterFid( fid );
req.setConnectionTimeout( 10000 );
req.setFreeConnectionsRequirement( 1 );
QgsFeatureIterator fIt = vl->getFeatures( req );

QgsFeature fet;
Expand Down Expand Up @@ -3609,6 +3611,8 @@ static QVariant fcnGetFeature( const QVariantList &values, const QgsExpressionCo
req.setFilterExpression( QStringLiteral( "%1=%2" ).arg( QgsExpression::quotedColumnRef( attribute ),
QgsExpression::quotedString( attVal.toString() ) ) );
req.setLimit( 1 );
req.setConnectionTimeout( 10000 );
req.setFreeConnectionsRequirement( 1 );
if ( !parent->needsGeometry() )
{
req.setFlags( QgsFeatureRequest::NoGeometry );
Expand Down

0 comments on commit 5252bf1

Please sign in to comment.