core: fixed memory initialisation sequence
This commit is contained in:
parent
4c4f590898
commit
cbb28ffcff
1 changed files with 5 additions and 8 deletions
|
|
@ -494,7 +494,6 @@ class Memory:
|
|||
def __init__(self, host):
|
||||
info (_("Memory manager init"))
|
||||
self.initialized = defer.Deferred()
|
||||
init_defers = [] #list of deferred to wait before initialization is finished
|
||||
self.host = host
|
||||
self.contacts={}
|
||||
self.presenceStatus={}
|
||||
|
|
@ -511,9 +510,8 @@ class Memory:
|
|||
self.storage = SqliteStorage(database_file)
|
||||
self.params=Param(host, self.storage)
|
||||
self.loadFiles()
|
||||
self.storage.initialized.addCallback(lambda ignore: self.load(init_defers))
|
||||
|
||||
defer.DeferredList(init_defers).chainDeferred(self.initialized)
|
||||
d = self.storage.initialized.addCallback(self.load)
|
||||
d.chainDeferred(self.initialized)
|
||||
|
||||
def parseMainConf(self):
|
||||
"""look for main .ini configuration file, and parse it"""
|
||||
|
|
@ -568,11 +566,10 @@ class Memory:
|
|||
except:
|
||||
error (_("Can't load private values !"))
|
||||
|
||||
def load(self, init_defers):
|
||||
"""Load parameters and all memory things from db
|
||||
@param init_defers: list of deferred to wait before parameters are loaded"""
|
||||
def load(self, ignore):
|
||||
"""Load parameters and all memory things from db"""
|
||||
#parameters data
|
||||
init_defers.append(self.params.loadGenParams())
|
||||
return self.params.loadGenParams()
|
||||
|
||||
def loadIndividualParams(self, profile):
|
||||
"""Load individual parameters for a profile
|
||||
|
|
|
|||
Loading…
Reference in a new issue