fix-migration-call
This commit is contained in:
parent
6268e3f2c7
commit
3e188a54c3
|
@ -258,17 +258,21 @@ def data_load():
|
||||||
return storage
|
return storage
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def handling_migration():
|
||||||
init_tables()
|
init_tables()
|
||||||
await all_handle(data_load(), sys.argv)
|
await all_handle(data_load(), sys.argv)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def process():
|
||||||
if "migrate" in sys.argv:
|
if "migrate" in sys.argv:
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
loop.run_until_complete(main())
|
loop.run_until_complete(handling_migration())
|
||||||
elif "bson" in sys.argv:
|
elif "bson" in sys.argv:
|
||||||
import bson2json
|
import bson2json
|
||||||
bson2json.json_tables()
|
bson2json.json_tables()
|
||||||
else:
|
else:
|
||||||
print("[migration] usage: python server.py migrate")
|
print("[migration] usage: python server.py migrate")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
process()
|
||||||
|
|
|
@ -89,10 +89,10 @@ if __name__ == "__main__":
|
||||||
reload=want_reload
|
reload=want_reload
|
||||||
) # , ssl_keyfile="discours.key", ssl_certfile="discours.crt")
|
) # , ssl_keyfile="discours.key", ssl_certfile="discours.crt")
|
||||||
elif x == "migrate":
|
elif x == "migrate":
|
||||||
from migration import migrate
|
from migration import process
|
||||||
print("MODE: MIGRATE")
|
print("MODE: MIGRATE")
|
||||||
|
|
||||||
migrate()
|
process()
|
||||||
elif x == "bson":
|
elif x == "bson":
|
||||||
from migration.bson2json import json_tables
|
from migration.bson2json import json_tables
|
||||||
print("MODE: BSON")
|
print("MODE: BSON")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user