fix: ES 自动创建索引

This commit is contained in:
xinwen
2021-04-13 09:18:29 +08:00
committed by 老广
parent b97759687d
commit ce6b9de07c
3 changed files with 36 additions and 1 deletions

View File

@@ -76,6 +76,15 @@ class CommandStorage(CommonModelMixin):
qs.model = Command
return qs
def save(self, force_insert=False, force_update=False, using=None,
update_fields=None):
super().save()
if self.type in TYPE_ENGINE_MAPPING:
engine_mod = import_module(TYPE_ENGINE_MAPPING[self.type])
backend = engine_mod.CommandStore(self.config)
backend.pre_use_check()
class ReplayStorage(CommonModelMixin):
name = models.CharField(max_length=128, verbose_name=_("Name"), unique=True)