Config from args
This commit is contained in:
parent
40c50328d0
commit
adf16c9059
|
@ -423,9 +423,9 @@ class Manager:
|
|||
self.shmem.unlink()
|
||||
|
||||
|
||||
async def main():
|
||||
async def main(cfg_path: str = "./settings.json", *_):
|
||||
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.SIGUSR2, mgr.on_sigusr2)
|
||||
|
||||
|
@ -437,4 +437,5 @@ async def main():
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
from sys import argv
|
||||
asyncio.run(main(*argv[1:]))
|
||||
|
|
Loading…
Reference in New Issue