|
@@ -18,6 +18,7 @@ from email.mime.text import MIMEText
|
|
|
from email.mime.image import MIMEImage
|
|
|
from email.mime.multipart import MIMEMultipart
|
|
|
import requests
|
|
|
+import threading
|
|
|
|
|
|
app = FastAPI()
|
|
|
app.add_middleware(
|
|
@@ -29,6 +30,13 @@ app.add_middleware(
|
|
|
)
|
|
|
|
|
|
|
|
|
+def thread_mail(umail):
|
|
|
+ print('thread_mail called')
|
|
|
+# r = requests.get('http://3.220.159.187:8081/mailto/'+umail)
|
|
|
+# print(r.text)
|
|
|
+# os.chdir('/root/hhh_step_question/step_question/tests')
|
|
|
+# os.system('python3 /root/hhh_step_question/step_question/tests/dftest.py &')
|
|
|
+
|
|
|
|
|
|
def get_db():
|
|
|
# db = dataset.connect('mysql://choozmo:pAssw0rd@139.162.121.30:33306/hhh?charset=utf8mb4')
|
|
@@ -100,6 +108,8 @@ app.mount("/a1", StaticFiles(directory="static"), name="static")
|
|
|
async def redirect():
|
|
|
# url = app.url_path_for("/a1/index.html")
|
|
|
response = RedirectResponse(url='/a1/index.html')
|
|
|
+ x = threading.Thread(target=thread_mail, args=(1,))
|
|
|
+ x.start()
|
|
|
return response
|
|
|
|
|
|
#@app.get("/a1", response_class=HTMLResponse)
|