diff src/memory/memory.py @ 1723:5632c5350296

core: avoid initialisation blocking when a long callback is added to backend.initialised (could prevent sessions starting)
author Goffi <goffi@goffi.org>
date Mon, 07 Dec 2015 13:10:44 +0100
parents 292f9c2712f2
children d17772b0fe22
line wrap: on
line diff
--- a/src/memory/memory.py	Mon Dec 07 13:10:44 2015 +0100
+++ b/src/memory/memory.py	Mon Dec 07 13:10:44 2015 +0100
@@ -355,7 +355,10 @@
             auth_d.addCallback(doStartSession)
             return auth_d
 
-        return self.host.initialised.addCallback(backendInitialised)
+        if self.host.initialised.called:
+            return defer.succeed(None).addCallback(backendInitialised)
+        else:
+            return self.host.initialised.addCallback(backendInitialised)
 
     def stopSession(self, profile):
         """Delete a profile session