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)
loop = asyncio.get_event_loop()
if args.action == "create":
data.create_database()
@ -55,19 +57,15 @@ if __name__ == "__main__":
data.schema_downgrade(args.version)
elif args.action == "create-owner":
loop = asyncio.get_event_loop()
loop.run_until_complete(data.create_owner(args.email, args.access_code))
elif args.action == "migrate":
loop = asyncio.get_event_loop()
loop.run_until_complete(data.migrate())
elif args.action == "create-revision":
loop = asyncio.get_event_loop()
loop.run_until_complete(data.create_revision(args.message))
elif args.action == "create-autorevision":
loop = asyncio.get_event_loop()
loop.run_until_complete(data.create_revision_auto(args.message))
else: