Wait for current loop iteration to finish before moving on to next iteration.

This commit is contained in:
Itamar Turner-Trauring 2023-03-14 12:02:32 -04:00
parent aa18c3418f
commit f8ea650b92

View File

@ -1239,9 +1239,13 @@ class HTTPNativeStorageServer(service.MultiService):
self._failed_to_connect
)
# TODO Make sure LoopingCall waits for the above timeout for looping again:
# https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3981
#return self._connecting_deferred or maye await it
# We don't want to do another iteration of the loop until this
# iteration has finished, so wait here:
try:
if self._connecting_deferred is not None:
await self._connecting_deferred
except Exception as e:
log.msg(f"Failed to connect to a HTTP storage server: {e}", level=log.CURIOUS)
def stopService(self):
if self._connecting_deferred is not None: