diff options
author | Dhruv Venkataraman | 2022-10-03 00:01:29 -0400 |
---|---|---|
committer | Dhruv Venkataraman | 2022-10-03 00:01:29 -0400 |
commit | 05ef2780215f1348b5ea326a909ebd6b1d51edf8 (patch) | |
tree | f704fb5ee725712857275e67794b8e6c92952d55 | |
parent | 3a3e5874f6ecd5f157dba2c41243502b411e2beb (diff) |
whee
-rw-r--r-- | backend/app.py | 4 |
1 files changed, 4 insertions, 0 deletions
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/<freq>') 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/<freq2>') def freq2(freq2): global threadFlag + global thread2 threadFlag = True + thread2.stop() return("200") if __name__ == "__main__": |