Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add QgsApplication::maxConcurrentConnectionsPerPool()
- Loading branch information
|
@@ -797,6 +797,13 @@ Do not include generated variables (like system name, user name etc.) |
|
|
Set a single custom expression variable. |
|
|
|
|
|
.. versionadded:: 3.0 |
|
|
%End |
|
|
|
|
|
int maxConcurrentConnectionsPerPool() const; |
|
|
%Docstring |
|
|
The maximum number of concurrent connections per connections pool |
|
|
|
|
|
.. versionadded:: 3.4 |
|
|
%End |
|
|
|
|
|
%If (ANDROID) |
|
|
|
@@ -85,6 +85,8 @@ |
|
|
#include <cpl_conv.h> // for setting gdal options |
|
|
#include <sqlite3.h> |
|
|
|
|
|
#define CONN_POOL_MAX_CONCURRENT_CONNS 6 |
|
|
|
|
|
QObject *ABISYM( QgsApplication::mFileOpenEventReceiver ); |
|
|
QStringList ABISYM( QgsApplication::mFileOpenEventList ); |
|
|
QString ABISYM( QgsApplication::mPrefixPath ); |
|
@@ -1461,6 +1463,10 @@ void QgsApplication::setCustomVariable( const QString &name, const QVariant &val |
|
|
emit instance()->customVariablesChanged(); |
|
|
} |
|
|
|
|
|
int QgsApplication::maxConcurrentConnectionsPerPool() const |
|
|
{ |
|
|
return CONN_POOL_MAX_CONCURRENT_CONNS; |
|
|
} |
|
|
|
|
|
QString QgsApplication::nullRepresentation() |
|
|
{ |
|
|
|
@@ -732,6 +732,13 @@ class CORE_EXPORT QgsApplication : public QApplication |
|
|
*/ |
|
|
static void setCustomVariable( const QString &name, const QVariant &value ); |
|
|
|
|
|
/** |
|
|
* The maximum number of concurrent connections per connections pool |
|
|
* |
|
|
* \since QGIS 3.4 |
|
|
*/ |
|
|
int maxConcurrentConnectionsPerPool() const; |
|
|
|
|
|
#ifdef SIP_RUN |
|
|
SIP_IF_FEATURE( ANDROID ) |
|
|
//dummy method to workaround sip generation issue |
|
|
|
@@ -19,6 +19,7 @@ |
|
|
#define SIP_NO_FILE |
|
|
|
|
|
#include "qgis.h" |
|
|
#include "qgsapplication.h" |
|
|
#include <QCoreApplication> |
|
|
#include <QMap> |
|
|
#include <QMutex> |
|
@@ -29,7 +30,6 @@ |
|
|
#include <QThread> |
|
|
|
|
|
|
|
|
#define CONN_POOL_MAX_CONCURRENT_CONNS 6 |
|
|
#define CONN_POOL_EXPIRATION_TIME 60 // in seconds |
|
|
|
|
|
|
|
@@ -59,8 +59,6 @@ class QgsConnectionPoolGroup |
|
|
{ |
|
|
public: |
|
|
|
|
|
static const int MAX_CONCURRENT_CONNECTIONS; |
|
|
|
|
|
struct Item |
|
|
{ |
|
|
T c; |
|
@@ -69,7 +67,7 @@ class QgsConnectionPoolGroup |
|
|
|
|
|
QgsConnectionPoolGroup( const QString &ci ) |
|
|
: connInfo( ci ) |
|
|
, sem( CONN_POOL_MAX_CONCURRENT_CONNS ) |
|
|
, sem( QgsApplication::instance()->maxConcurrentConnectionsPerPool() ) |
|
|
{ |
|
|
} |
|
|
|
|
|