Skip to content

Commit 8523dfd

Browse files
committed
Tolerate delayed Wi-Fi interfaces
The service is not restarting as expected after crashing. Avoid the crash by retrying NM several times first. Closes #270
1 parent f37c7ee commit 8523dfd

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

comitup/comitup.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,25 @@ def main():
135135
sys.exit(1)
136136
else:
137137
sys.exit(0)
138-
else:
139-
if wificheck.run_checks(
138+
139+
got_intfs: int = False
140+
check_count = 0
141+
while got_intfs is False:
142+
check_count += 1
143+
if not wificheck.run_checks(
140144
logit=True,
141145
verbose=False,
142146
primary_dev=conf.primary_wifi_device,
143147
):
148+
got_intfs = True
149+
150+
if check_count >= 5:
151+
log.error("No valid interfaces")
144152
sys.exit(1)
145153

154+
if not got_intfs:
155+
time.sleep(2)
156+
146157
check_environment(log)
147158

148159
webmgr.init_webmgr(conf.web_service)

0 commit comments

Comments
 (0)