diff sat/core/sat_main.py @ 3537:f9a5b810f14d

core (memory/storage): backend storage is now based on SQLAlchemy
author Goffi <goffi@goffi.org>
date Thu, 03 Jun 2021 15:20:47 +0200
parents 7550ae9cfbac
children 60d3861e5996
line wrap: on
line diff
--- a/sat/core/sat_main.py	Thu Jun 03 15:15:11 2021 +0200
+++ b/sat/core/sat_main.py	Thu Jun 03 15:20:47 2021 +0200
@@ -58,6 +58,7 @@
 log = getLogger(__name__)
 
 class SAT(service.Service):
+
     def _init(self):
         # we don't use __init__ to avoid doule initialisation with twistd
         # this _init is called in startService
@@ -175,8 +176,7 @@
         self.bridge.register_method("imageResize", self._imageResize)
         self.bridge.register_method("imageGeneratePreview", self._imageGeneratePreview)
         self.bridge.register_method("imageConvert", self._imageConvert)
-
-        self.memory.initialized.addCallback(lambda __: defer.ensureDeferred(self._postMemoryInit()))
+        defer.ensureDeferred(self._postInit())
 
     @property
     def version(self):
@@ -206,8 +206,8 @@
     def bridge_name(self):
         return os.path.splitext(os.path.basename(self.bridge.__file__))[0]
 
-    async def _postMemoryInit(self):
-        """Method called after memory initialization is done"""
+    async def _postInit(self):
+        await self.memory.initialise()
         self.common_cache = cache.Cache(self, None)
         log.info(_("Memory initialised"))
         try: