From bb5de9a00e78f007282332ba16c062dc012da2a7 Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Thu, 12 May 2022 22:15:09 +0200 Subject: [PATCH] Update insert_event.py. This script now works with the new event log. Fixes #234. Midnight positions can be added via a cronjob such as: $DOUGAL_ROOT/BIN/insert_event.py -t "$(date -I) 00:00:00Z" \ -l Daily -l Prod \ "Midnight position: @DMS@ (@POS@)" --- bin/insert_event.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/insert_event.py b/bin/insert_event.py index fd3e022..ebade30 100755 --- a/bin/insert_event.py +++ b/bin/insert_event.py @@ -38,11 +38,11 @@ if __name__ == '__main__': message = " ".join(args["remarks"]) - print("new event:", schema, tstamp, message) + print("new event:", schema, tstamp, message, args["label"]) if schema and tstamp and message: db.set_survey(schema) with db.conn.cursor() as cursor: - qry = "INSERT INTO events_timed (tstamp, remarks) VALUES (%s, %s);" - cursor.execute(qry, (tstamp, message)) + qry = "INSERT INTO event_log (tstamp, remarks, labels) VALUES (%s, replace_placeholders(%s, %s, NULL, NULL), %s);" + cursor.execute(qry, (tstamp, message, tstamp, args["label"])) db.maybe_commit()