From 92cc597e84b35b9524a45c16688c58df707a2090 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Wed, 12 Feb 2020 10:22:31 -0500 Subject: [PATCH] set actual counter/start/end values in the event generation script --- tools/scripts/firehose.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/scripts/firehose.py b/tools/scripts/firehose.py index 9cff77a692..91d6569f9e 100755 --- a/tools/scripts/firehose.py +++ b/tools/scripts/firehose.py @@ -162,6 +162,19 @@ if __name__ == '__main__': w.join() workers = [] + + print('generating unique start/end line counts') + cursor.execute('CREATE SEQUENCE IF NOT EXISTS firehose_seq;') + cursor.execute('CREATE SEQUENCE IF NOT EXISTS firehose_line_seq;') + conn.commit() + + cursor.execute( + "UPDATE main_jobevent SET " + "counter=nextval('firehose_seq')::integer," + "start_line=nextval('firehose_seq')::integer," + "end_line=currval('firehose_seq')::integer + 2" + ) + conn.commit() finally: # restore all indexes print(datetime.datetime.utcnow().isoformat())