From 05ef2780215f1348b5ea326a909ebd6b1d51edf8 Mon Sep 17 00:00:00 2001 From: Dhruv Venkataraman Date: Mon, 3 Oct 2022 00:01:29 -0400 Subject: whee --- backend/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/app.py b/backend/app.py index b638ba6..4382c7a 100644 --- a/backend/app.py +++ b/backend/app.py @@ -12,6 +12,7 @@ def playFunction(freq): os.system("beep -f"+ freq+" -l 100000") #print("beep -f %f" % (freq)) +thread2 = 0 tc = 0 @app.before_first_request def activate_job(): @@ -21,6 +22,7 @@ def activate_job(): @app.route('/startfreq/') def freq(freq): global threadFlag + global thread2 threadFlag = False print(freq) thread2 = Thread(target=playFunction, args=(freq,)) @@ -30,7 +32,9 @@ def freq(freq): @app.route('/stopfreq/') def freq2(freq2): global threadFlag + global thread2 threadFlag = True + thread2.stop() return("200") if __name__ == "__main__": -- cgit v1.2.3-70-g09d2