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 committed 2023-08-30 15:58:32 +03:00
1 parent 8b25a9265f
commit 4271a6f4a0
7 files changed
+123 -37

No files matched your search

+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!"}