Skip to content

Commit b4e6ed8

Browse files
Eric YeAutomatedTester
authored andcommitted
Add retry sleep and count in options
1 parent 663ffed commit b4e6ed8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

browsermobproxy/server.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ def start(self, options=None):
102102
options = {
103103
'log_path': os.getcwd(),
104104
'log_file': 'server.log',
105+
'retry_sleep': 0.5,
106+
'retry_count': 60,
105107
}
106108
log_path = options.get('log_path')
107109
log_file = options.get('log_file')
@@ -120,9 +122,9 @@ def start(self, options=None):
120122
"for a helpful error message.".format(self.log_file))
121123

122124
raise Exception(message)
123-
time.sleep(0.5)
125+
time.sleep(options.get('retry_sleep'))
124126
count += 1
125-
if count == 60:
127+
if count == options.get('retry_count'):
126128
self.stop()
127129
raise Exception("Can't connect to Browsermob-Proxy")
128130

0 commit comments

Comments
 (0)