mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
fix: move mqtt_client.on_message assignment under function definition
This commit is contained in:
@@ -24,6 +24,9 @@ mqtt_client.connect("localhost", 1884, 60)
|
|||||||
mqtt_client.loop_start()
|
mqtt_client.loop_start()
|
||||||
mqtt_client.subscribe("kobuki/data")
|
mqtt_client.subscribe("kobuki/data")
|
||||||
|
|
||||||
|
mqtt_client.on_message = on_message # this line needs to be under the function definition otherwise it can't find which function it needs to use
|
||||||
|
|
||||||
|
|
||||||
# Database connectie-functie
|
# Database connectie-functie
|
||||||
def get_db():
|
def get_db():
|
||||||
if 'db' not in g: # 'g' is specifiek voor een request en leeft zolang een request duurt
|
if 'db' not in g: # 'g' is specifiek voor een request en leeft zolang een request duurt
|
||||||
|
Reference in New Issue
Block a user