fix the issue at the foglamp restart
@@ -705,6 +705,13 @@ class Server:
# Reset identified rows of the streams table
if len(streams_id) >= 0:
for _stream_id in streams_id:
+
+ # Checks if there is the row in the Stream table to avoid an error during the update
+ where = 'id={0}'.format(_stream_id)
+ streams = loop.run_until_complete(cls._readings_client_async.query_tbl('streams', where))
+ rows = streams['rows']
+
+ if len(rows) > 0:
payload = payload_builder.PayloadBuilder().SET(last_object=0, ts='now()')\
.WHERE(['id', '=', _stream_id]).payload()
loop.run_until_complete(cls._storage_client_async.update_tbl("streams", payload))
