Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit351cd65

Browse files
committed
fix reconnect error handling in EventHistory
1 parentb6e113a commit351cd65

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

‎tests2/lib/bank_client.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,17 @@ def exec_tx(self, name, tx_block):
127127
whileself.run.value:
128128
event_id=self.history.register_start(name)
129129

130-
ifconn.closed:
131-
self.history.register_finish(event_id,'ReConnect')
132-
conn=psycopg2.connect(self.connstr)
133-
cur=conn.cursor()
134-
135130
try:
131+
ifconn.closed:
132+
conn=psycopg2.connect(self.connstr)
133+
cur=conn.cursor()
134+
self.history.register_finish(event_id,'ReConnect')
135+
continue
136+
136137
tx_block(conn,cur)
137138
self.history.register_finish(event_id,'Commit')
138-
exceptpsycopg2.InterfaceError:
139-
self.history.register_finish(event_id,'InterfaceError')
140-
exceptpsycopg2.Errorasx:
141-
print(x.pgerror)
142-
self.history.register_finish(event_id,'PsycopgError')
139+
exceptpsycopg2.Errorase:
140+
self.history.register_finish(event_id,e.pgerror)
143141

144142
cur.close()
145143
conn.close()

‎tests2/lib/event_history.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def load_queue(self):
4646
# finish mark
4747
ifevent['event_id']notinself.running_events:
4848
# found finish event without corresponding start
49+
print(event)
4950
print("ololololo!")
5051
raise
5152

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp