set actual counter/start/end values in the event generation script

This commit is contained in:
Ryan Petrello 2020-02-12 10:22:31 -05:00
parent 4a455c7bf7
commit 92cc597e84
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -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())