Skip to content
Permalink
Browse files
[Server] Layer cache messages
  • Loading branch information
rldhont committed Mar 20, 2017
1 parent 874c726 commit b15d9e49e66c095b237daabbc77cbb15003c0cac
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/server/qgsmslayercache.cpp
@@ -34,6 +34,7 @@ QgsMSLayerCache* QgsMSLayerCache::instance()
QgsMSLayerCache::QgsMSLayerCache()
: mProjectMaxLayers( 0 )
{
QgsMessageLog::logMessage( "QgsMSLayerCache initialized", "Server", QgsMessageLog::INFO );
mDefaultMaxLayers = 100;
//max layer from environment variable overrides default
char* maxLayerEnv = getenv( "MAX_CACHE_LAYERS" );
@@ -61,7 +62,7 @@ QgsMSLayerCache::~QgsMSLayerCache()

void QgsMSLayerCache::insertLayer( const QString& url, const QString& layerName, QgsMapLayer* layer, const QString& configFile, const QList<QString>& tempFiles )
{
QgsMessageLog::logMessage( "Layer cache: insert Layer '" + layerName + "' configFile: " + configFile, "Server", QgsMessageLog::INFO );
QgsMessageLog::logMessage( "Layer cache: insert Layer '" + layerName + "' url: '" + url + "' configFile: " + configFile, "Server", QgsMessageLog::INFO );
if ( mEntries.size() > qMax( mDefaultMaxLayers, mProjectMaxLayers ) ) //force cache layer examination after 10 inserted layers
{
updateEntries();
@@ -100,7 +101,7 @@ QgsMapLayer* QgsMSLayerCache::searchLayer( const QString& url, const QString& la
QPair<QString, QString> urlNamePair = qMakePair( url, layerName );
if ( !mEntries.contains( urlNamePair ) )
{
QgsMessageLog::logMessage( "Layer '" + layerName + "' configFile: " + configFile + " not found in layer cache'", "Server", QgsMessageLog::INFO );
QgsMessageLog::logMessage( "Layer '" + layerName + "' url: '" + url + "' configFile: " + configFile + " not found in layer cache'", "Server", QgsMessageLog::INFO );
return nullptr;
}
else
@@ -112,11 +113,11 @@ QgsMapLayer* QgsMSLayerCache::searchLayer( const QString& url, const QString& la
if ( configFile.isEmpty() || layerIt->configFile == configFile )
{
layerIt->lastUsedTime = time( nullptr );
QgsMessageLog::logMessage( "Layer '" + layerName + "' configFile: " + configFile + " found in layer cache", "Server", QgsMessageLog::INFO );
QgsMessageLog::logMessage( "Layer '" + layerName + "' url: '" + url + "' configFile: " + configFile + " found in layer cache", "Server", QgsMessageLog::INFO );
return layerIt->layerPointer;
}
}
QgsMessageLog::logMessage( "Layer '" + layerName + "' configFile: " + configFile + " not found in layer cache'", "Server", QgsMessageLog::INFO );
QgsMessageLog::logMessage( "Layer '" + layerName + "' url: '" + url + "' configFile: " + configFile + " not found in layer cache'", "Server", QgsMessageLog::INFO );
return nullptr;
}
}

0 comments on commit b15d9e4

Please sign in to comment.