mirror of https://github.com/jumpserver/jumpserver
perf: Improve performance by optimizing ES index creation
parent
b3a0d81740
commit
32ec48ac14
|
@ -190,7 +190,8 @@ class ES(object):
|
||||||
mappings['aliases'] = {
|
mappings['aliases'] = {
|
||||||
self.query_index: {}
|
self.query_index: {}
|
||||||
}
|
}
|
||||||
|
if self.es.indices.exists(index=self.index):
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
self.es.indices.create(index=self.index, body=mappings)
|
self.es.indices.create(index=self.index, body=mappings)
|
||||||
except (RequestError, BadRequestError) as e:
|
except (RequestError, BadRequestError) as e:
|
||||||
|
|
Loading…
Reference in New Issue