add route to trigger Populate

+ use instance keys to stop multiple instances of populate
+ move Populate error to a new file
+ misc
This commit is contained in:
mungai-njoroge
2023-08-30 15:58:32 +03:00
parent 8b25a9265f
commit 4271a6f4a0
7 changed files with 123 additions and 37 deletions
+15
View File
@@ -223,3 +223,18 @@ def set_setting():
value = ",".join(value)
return {"result": value}
@background
def run_populate():
populate.Populate(instance_key=get_random_str())
@api.route("/settings/trigger-scan", methods=["GET"])
def trigger_scan():
"""
Triggers a scan.
"""
run_populate()
return {"msg": "Scan triggered!"}