File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 11
11
from common .errors import WifiNoSuitableDevice
12
12
from common .nm_dicts import get_nm_dict
13
13
from common .system import led
14
+ from time import sleep
14
15
15
16
16
17
# Import DBus mainloop for NetworkManager use
@@ -176,13 +177,19 @@ def forget(create_new_hotspot=False, all_networks=False):
176
177
== "802-11-wireless" :
177
178
# Delete the identified connection
178
179
network_id = connection .GetSettings ()["connection" ]["id" ]
180
+ # Add short delay to ensure the endpoint has returned a
181
+ # response before disconnecting the user.
182
+ sleep (0.5 )
179
183
connection .Delete ()
180
184
logger .debug (f"Deleted connection: { network_id } " )
181
185
else :
182
186
connection_id = get_connection_id ()
183
187
# connection_id returns false if it is missing. This can be ignored
184
188
# as this function is often called as a precautionary clean up
185
189
if connection_id :
190
+ # Add short delay to ensure the endpoint has returned a
191
+ # response before disconnecting the user.
192
+ sleep (0.5 )
186
193
connection_id .Delete ()
187
194
logger .debug (f"Deleted connection: { config .ap_name } " )
188
195
You can’t perform that action at this time.
0 commit comments