Support both sync and asyncio uses
This commit is contained in:
parent
ca6ae7d6e9
commit
5ab53c916c
10 changed files with 47 additions and 70 deletions
|
@ -6,8 +6,6 @@ from typing import List, Optional
|
|||
|
||||
from aioredis import Redis, ResponseError
|
||||
|
||||
from aredis_om.model.model import model_registry
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -96,6 +94,10 @@ class Migrator:
|
|||
if self.module:
|
||||
import_submodules(self.module)
|
||||
|
||||
# Import this at run-time to avoid triggering import-time side effects,
|
||||
# e.g. checks for RedisJSON, etc.
|
||||
from aredis_om.model.model import model_registry
|
||||
|
||||
for name, cls in model_registry.items():
|
||||
hash_key = schema_hash_key(cls.Meta.index_name)
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue