From 34b51fa83eda8dff276dec009e753956ded7a0e4 Mon Sep 17 00:00:00 2001 From: tech234a <46801700+tech234a@users.noreply.github.com> Date: Fri, 25 Sep 2020 16:52:44 -0400 Subject: [PATCH] Fix aioquic on Heroku --- http3.py | 12 ++++++++++++ worker.py | 5 ----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/http3.py b/http3.py index 1ecf558..7731972 100644 --- a/http3.py +++ b/http3.py @@ -1,3 +1,15 @@ +from os import system +from os.path import isfile +HEROKU = False +if isfile("../Procfile") and isfile("../requirements.txt"): + print("Heroku detected... using 20 threads instead of 50.") + HEROKU = True + +if HEROKU: + if not "aioquic" in open("../requirements.txt").read(): + print("Installing aioquic on this Heroku instance since it wasn't installed on deploy...") + system("pip install --user aioquic") + import asyncio from typing import cast from urllib.parse import urlparse diff --git a/worker.py b/worker.py index 1da1909..314973e 100644 --- a/worker.py +++ b/worker.py @@ -10,11 +10,6 @@ if isfile("../Procfile") and isfile("../requirements.txt"): print("Heroku detected... using 20 threads instead of 50.") HEROKU = True -if HEROKU: - if not "aioquic" in open("../requirements.txt").read(): - print("Installing aioquic on this Heroku instance since it wasn't installed on deploy...") - system("pip install --user aioquic") - import signal import tracker