Re-add pid file

This commit is contained in:
Samuel Sloniker 2023-05-06 09:22:10 -07:00
parent 16d7649e45
commit 21e0317979

View File

@ -83,4 +83,13 @@ if __name__ == "__main__":
args = parser.parse_args()
config = load_config(args.config_file)
run(config)
try:
if config["pid_file"]:
with open(config["pid_file"], "w+") as f:
f.write(str(os.getpid()))
run(config)
finally:
if config["pid_file"]:
os.unlink(config["pid_file"])