1
0
mirror of synced 2024-11-24 06:20:10 +01:00

dbutils: get loop once at top of file

This commit is contained in:
Hay1tsme 2024-07-06 21:59:18 -04:00
parent 51a47e51d9
commit 15cf56ed9b

View File

@ -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: