Merge pull request #5918 from ryanpetrello/real-event-firehose-values

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

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-02-13 19:47:42 +00:00 committed by GitHub
commit f4e09eee80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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