diff options
-rwxr-xr-x | lorry-controller-webapp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lorry-controller-webapp b/lorry-controller-webapp index 3963853..884a3f5 100755 --- a/lorry-controller-webapp +++ b/lorry-controller-webapp @@ -71,12 +71,16 @@ class StateDB(object): self._open() c = self._conn.cursor() for (running,) in c.execute('SELECT running FROM running_queue'): - return running + return bool(running) def set_running_queue(self, new_status): + if new_status: + new_value = 1 + else: + new_value = 0 self._open() c = self._conn.cursor() - c.execute('UPDATE running_queue SET running = ?', str(new_status)) + c.execute('UPDATE running_queue SET running = ?', str(new_value)) self._conn.commit() |