Push newly created watches directly into the update check Queue.

This commit is contained in:
Leigh Morresi
2021-02-02 17:50:05 +01:00
parent bbd99c9aa9
commit 6a102374c6
2 changed files with 7 additions and 3 deletions

View File

@@ -310,7 +310,10 @@ def api_watch_add():
global messages
# @todo add_watch should throw a custom Exception for validation etc
datastore.add_watch(url=request.form.get('url').strip(), tag=request.form.get('tag').strip())
new_uuid = datastore.add_watch(url=request.form.get('url').strip(), tag=request.form.get('tag').strip())
# Straight into the queue.
update_q.put(new_uuid)
messages.append({'class': 'ok', 'message': 'Watch added.'})
return redirect(url_for('main_page'))