Get templateHash for static tile request and errored named map instantiations
This commit is contained in:
@@ -4,7 +4,7 @@ const BaseMapConfigProvider = require('./base-mapconfig-adapter');
|
||||
const crypto = require('crypto');
|
||||
const dot = require('dot');
|
||||
const MapConfig = require('windshaft').model.MapConfig;
|
||||
const templateName = require('../../../backends/template-maps').templateName;
|
||||
const { templateName, fingerPrint: templateFingerPrint } = require('../../../backends/template-maps');
|
||||
|
||||
// Configure bases for cache keys suitable for string interpolation
|
||||
const baseKey = '{{=it.dbname}}:{{=it.user}}:{{=it.templateName}}';
|
||||
@@ -258,6 +258,14 @@ module.exports = class NamedMapMapConfigProvider extends BaseMapConfigProvider {
|
||||
getTemplateName () {
|
||||
return this.templateName;
|
||||
}
|
||||
|
||||
getTemplateHash () {
|
||||
if (!this.template) {
|
||||
throw new Error('Missing template, call "getTemplate()" method first');
|
||||
}
|
||||
|
||||
return templateFingerPrint(this.template);
|
||||
}
|
||||
};
|
||||
|
||||
function createConfigHash (config) {
|
||||
|
||||
Reference in New Issue
Block a user