Config from args

This commit is contained in:
Casey 2024-07-09 14:47:59 +03:00
parent 40c50328d0
commit adf16c9059
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 4 additions and 3 deletions

View File

@ -423,9 +423,9 @@ class Manager:
self.shmem.unlink() self.shmem.unlink()
async def main(): async def main(cfg_path: str = "./settings.json", *_):
print(f"PID: {os.getpid()}") print(f"PID: {os.getpid()}")
async with Manager("./settings.json") as mgr: async with Manager(cfg_path) as mgr:
signal.signal(signal.SIGUSR1, mgr.on_sigusr1) signal.signal(signal.SIGUSR1, mgr.on_sigusr1)
signal.signal(signal.SIGUSR2, mgr.on_sigusr2) signal.signal(signal.SIGUSR2, mgr.on_sigusr2)
@ -437,4 +437,5 @@ async def main():
if __name__ == "__main__": if __name__ == "__main__":
asyncio.run(main()) from sys import argv
asyncio.run(main(*argv[1:]))