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 8, 2018
1 parent 7c8c6ca commit 6a9c5fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/expression/qgsexpressionfunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3527,6 +3527,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 @@ -3567,6 +3569,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 6a9c5fa

Please sign in to comment.