What does the executable do? #524
-
Hi, def _parse_json() -> list[str | None]:
# TODO: Parse JSON
return []
def _delete_pid_file(path: Path):
path.unlink(missing_ok=True)
def _pid_file() -> None:
pid_file = Path(os.getcwd(), 'daphne.pid')
# Write PID file
with open(pid_file, 'w', encoding='utf-8') as file:
file.write(str(os.getpid()))
# Make sure PID file is deleted, if the Python interpreter stops working
# @see https://docs.python.org/3.12/library/atexit.html
register(_delete_pid_file, pid_file)
if __name__ == '__main__':
print('Starting ASGI server...')
_pid_file()
cli = CommandLineInterface()
cli.run(_parse_json())
print('Stopping ASGI server, bye bye...') |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yep. Exactly. Line 204 in 4a55fac |
Beta Was this translation helpful? Give feedback.
Yep. Exactly.
daphne/daphne/cli.py
Line 204 in 4a55fac