Skip to content

Commit

Permalink
quick fix for uploading new config
Browse files Browse the repository at this point in the history
  • Loading branch information
Max McKelvey authored and Max McKelvey committed Aug 29, 2023
1 parent 920d161 commit 0a3f8bf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions api/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,22 @@ def intro_finished():
def set_config_post_method(config_str: dict):
if "config" not in config_str:
return "Failed"

# kill all processes
for p in app.DETECTOR_PROCESSES:
if p.is_alive():
p.kill()

app.DETECTOR_PROCESSES = []

# turn off all grabbers
for g in app.ALL_GRABBERS:
try:
g.release()
except:
pass

app.ALL_GRABBERS = []

try:
config = json.loads(config_str["config"])
Expand Down

0 comments on commit 0a3f8bf

Please sign in to comment.