Make real index name use uniqid so can be reset within a second

This commit is contained in:
Richard Miller 2014-02-10 10:55:13 +00:00
parent 3b1a756e6f
commit 03bf793b65

View file

@ -45,7 +45,7 @@ class Resetter
$esIndex = $indexConfig['index']; $esIndex = $indexConfig['index'];
if (isset($indexConfig['use_alias']) && $indexConfig['use_alias']) { if (isset($indexConfig['use_alias']) && $indexConfig['use_alias']) {
$name = $indexConfig['name_or_alias']; $name = $indexConfig['name_or_alias'];
$name .= date('-Y-m-d-Gis'); $name .= uniqid();
$esIndex->overrideName($name); $esIndex->overrideName($name);
$esIndex->create($indexConfig['config']); $esIndex->create($indexConfig['config']);
@ -124,7 +124,7 @@ class Resetter
} }
/** /**
* Switches the alias for given index to the newly populated index * Switches the alias for given index (by key) to the newly populated index
* and deletes the old index * and deletes the old index
* *
* @param string $indexName Index name * @param string $indexName Index name