updated other places that es is cleared to also clear templates

This commit is contained in:
Spencer Alger
2014-06-09 10:03:05 -07:00
parent b64afec7ee
commit 7a2571f11a
4 changed files with 15 additions and 18 deletions

View File

@ -13,6 +13,7 @@ var _ = require('../../../src/lib/utils');
var argv = require('./argv');
var path = require('path');
var fs = require('fs');
var async = require('async');
var fromRoot = _.bindKey(path, 'join', require('find-root')(__dirname));
// current client
@ -94,6 +95,17 @@ module.exports = {
log: logConfig
});
client.clearEs = function (done) {
async.parallel([
function (done) {
client.indices.delete({ index: '*', ignore: 404 }, done);
},
function (done) {
client.indices.deleteTemplate({ name: '*', ignore: 404 }, done);
}
], done);
};
_.nextTick(cb);
}
},