From 081cc41a342ddd8a97f491f05478d10fabc3e815 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 7 Dec 2012 20:20:21 +0100 Subject: [PATCH] Drop extended styles. Closes #58. Add some documentation in header. --- NEWS.md | 1 + tools/reset_styles | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4bcbe73b..1a1779df 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ ----- * Reduce default extent to allow for consistent proj4 round-tripping * Enhance reset_styles script to use full configuration (#62) +* Have reset_styles script also drop extended keys (#58) * Fix example postgis parameter for simplifying input geoms (#63) 1.1.3 (30//11//12) diff --git a/tools/reset_styles b/tools/reset_styles index bd07d856..b45c1a6b 100755 --- a/tools/reset_styles +++ b/tools/reset_styles @@ -1,5 +1,18 @@ #!/usr/bin/env node +/* + +This scripts drops all extended map_style keys in redis and regenerates +the XML caches in all the base ones to target the configured mapnik_version. + +Optionally (with --convert) it also re-writes the CartoCSS if needed +to target the configured mapnik_version. + +It is recommended to make a backup of the redis database before using +this script. + +*/ + var path = require('path'); // Reset all styles in the store @@ -56,10 +69,12 @@ client.on('connect', function() { var k = matches.shift(); if ( /map_style\|.*\|.*\|/.test(k) ) { - //console.warn("Key " + k + " is EXTENDED, skipping"); - // TODO: drop instead ? // See https://github.com/Vizzuality/Windshaft-cartodb/issues/58 - processNext(); + //console.warn("Key " + k + " is EXTENDED, dropping"); + client.del(k, function(err) { + if ( err ) console.warn("Error dropping key " + k); + processNext(); + }); return; }