Skip to content

Commit 97937b3

Browse files
committed
Jobs table modified to store the algorithm id
1 parent 5aef17d commit 97937b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

code/service/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ def execute_algorithm(
211211
logger.info(f"Creating job to process ticket {ticket_id}")
212212
conn = get_db()
213213
cursor = conn.cursor()
214-
instruction = f"INSERT INTO jobs VALUES ('{ticket_id}','{file.filename}',{JOB_SCHEDULED})"
214+
instruction = f"INSERT INTO jobs VALUES ('{ticket_id}','{file.filename}',{JOB_SCHEDULED},'{algorithm_id}')"
215215
cursor.execute(instruction)
216216
conn.commit()
217217
conn.close()
218218
logger.info(f"Job created to process ticket {ticket_id}")
219219

220220
#Publish job in mqtt server
221-
mqtt_message={"ticket":ticket_id, "file":file.filename}
221+
mqtt_message={"ticket":ticket_id, "file":file.filename, "algorithm":algorithm_id}
222222
logger.info(f"Sending message to broker: {str(mqtt_message)}")
223223
client = mqtt.Client()
224224
client.connect(settings.MQTT_HOST,settings.MQTT_PORT)

0 commit comments

Comments
 (0)