From 3bf367d630220314d7c309c082ce7b9af68ea450 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Mon, 13 Dec 2021 01:38:07 +0100 Subject: [PATCH] WebHost: don't bother queuing empty commands --- WebHostLib/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WebHostLib/__init__.py b/WebHostLib/__init__.py index d32267d2..e4ada5bc 100644 --- a/WebHostLib/__init__.py +++ b/WebHostLib/__init__.py @@ -166,8 +166,9 @@ def host_room(room: UUID): if request.method == "POST": if room.owner == session["_id"]: cmd = request.form["cmd"] - Command(room=room, commandtext=cmd) - commit() + if cmd: + Command(room=room, commandtext=cmd) + commit() with db_session: room.last_activity = datetime.utcnow() # will trigger a spinup, if it's not already running