forked from Hay1tsme/artemis
dbutils: get loop once at top of file
This commit is contained in:
parent
51a47e51d9
commit
15cf56ed9b
@ -42,6 +42,8 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
data = Data(cfg)
|
data = Data(cfg)
|
||||||
|
|
||||||
|
loop = asyncio.get_event_loop()
|
||||||
|
|
||||||
if args.action == "create":
|
if args.action == "create":
|
||||||
data.create_database()
|
data.create_database()
|
||||||
|
|
||||||
@ -55,19 +57,15 @@ if __name__ == "__main__":
|
|||||||
data.schema_downgrade(args.version)
|
data.schema_downgrade(args.version)
|
||||||
|
|
||||||
elif args.action == "create-owner":
|
elif args.action == "create-owner":
|
||||||
loop = asyncio.get_event_loop()
|
|
||||||
loop.run_until_complete(data.create_owner(args.email, args.access_code))
|
loop.run_until_complete(data.create_owner(args.email, args.access_code))
|
||||||
|
|
||||||
elif args.action == "migrate":
|
elif args.action == "migrate":
|
||||||
loop = asyncio.get_event_loop()
|
|
||||||
loop.run_until_complete(data.migrate())
|
loop.run_until_complete(data.migrate())
|
||||||
|
|
||||||
elif args.action == "create-revision":
|
elif args.action == "create-revision":
|
||||||
loop = asyncio.get_event_loop()
|
|
||||||
loop.run_until_complete(data.create_revision(args.message))
|
loop.run_until_complete(data.create_revision(args.message))
|
||||||
|
|
||||||
elif args.action == "create-autorevision":
|
elif args.action == "create-autorevision":
|
||||||
loop = asyncio.get_event_loop()
|
|
||||||
loop.run_until_complete(data.create_revision_auto(args.message))
|
loop.run_until_complete(data.create_revision_auto(args.message))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user