mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-20 07:43:35 -05:00
fix start/end line incrementing behavior
This commit is contained in:
@@ -209,14 +209,17 @@ def generate_events(events, job):
|
|||||||
|
|
||||||
print('generating unique start/end line counts')
|
print('generating unique start/end line counts')
|
||||||
cursor.execute('CREATE SEQUENCE IF NOT EXISTS firehose_seq;')
|
cursor.execute('CREATE SEQUENCE IF NOT EXISTS firehose_seq;')
|
||||||
cursor.execute('CREATE SEQUENCE IF NOT EXISTS firehose_line_seq;')
|
cursor.execute('CREATE SEQUENCE IF NOT EXISTS firehose_line_seq MINVALUE 0;')
|
||||||
|
cursor.execute('ALTER SEQUENCE firehose_seq RESTART WITH 1;')
|
||||||
|
cursor.execute('ALTER SEQUENCE firehose_line_seq RESTART WITH 0;')
|
||||||
|
cursor.execute("SELECT nextval('firehose_line_seq')")
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"UPDATE main_jobevent SET "
|
"UPDATE main_jobevent SET "
|
||||||
"counter=nextval('firehose_seq')::integer,"
|
"counter=nextval('firehose_seq')::integer,"
|
||||||
"start_line=nextval('firehose_seq')::integer,"
|
"start_line=nextval('firehose_line_seq')::integer,"
|
||||||
"end_line=currval('firehose_seq')::integer + 2"
|
"end_line=currval('firehose_line_seq')::integer + 2"
|
||||||
)
|
)
|
||||||
conn.commit()
|
conn.commit()
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Reference in New Issue
Block a user