handle new empty database on startup

This commit is contained in:
Morgan McMillian 2018-03-24 18:50:27 -07:00
parent d103a31df3
commit 2a1e384034

View file

@ -185,6 +185,7 @@ class ChannelMonitor(threading.Thread):
logging.info("-- Starting channel monitor --")
app.app_context().push()
rooms = MatrixRoom2.query.all()
if rooms:
self.txId = int(rooms[0].pnut_since)
while not _shutdown.isSet():
rooms = MatrixRoom2.query.all()