Merge pull request #393 from arabcoders/dev
Fix windows multiprocessing threads
This commit is contained in:
commit
8b9077d476
2 changed files with 6 additions and 2 deletions
|
|
@ -99,9 +99,9 @@ def update_env_file(env_file: pathlib.Path, port: int) -> None:
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="Start YTPTube server")
|
parser = argparse.ArgumentParser(description="Start YTPTube server", allow_abbrev=False)
|
||||||
parser.add_argument("--no-browser", action="store_true", help="Do not open browser on start")
|
parser.add_argument("--no-browser", action="store_true", help="Do not open browser on start")
|
||||||
args = parser.parse_args()
|
args, _ = parser.parse_known_args()
|
||||||
|
|
||||||
set_env()
|
set_env()
|
||||||
|
|
||||||
|
|
@ -130,4 +130,7 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
from multiprocessing import freeze_support
|
||||||
|
|
||||||
|
freeze_support()
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ async def shutdown_system(request: Request, config: Config, encoder: Encoder, no
|
||||||
|
|
||||||
# Schedule shutdown after response
|
# Schedule shutdown after response
|
||||||
asyncio.create_task(do_shutdown())
|
asyncio.create_task(do_shutdown())
|
||||||
|
LOG.info("Shutdown initiated by user request. Stopping the server...")
|
||||||
return web.json_response(
|
return web.json_response(
|
||||||
data={
|
data={
|
||||||
"message": "The application shutting down.",
|
"message": "The application shutting down.",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue