improve connection time. Fixes #5764
This commit is contained in:
parent
875840d212
commit
1d0ed41d15
|
@ -941,7 +941,8 @@ class Logger:
|
|||
for jid in roster:
|
||||
self.add_or_update_contact(account_jid, jid, roster[jid]['name'],
|
||||
roster[jid]['subscription'], roster[jid]['ask'],
|
||||
roster[jid]['groups'])
|
||||
roster[jid]['groups'], commit=False)
|
||||
self.con.commit()
|
||||
|
||||
# At this point, we are sure the replacement works properly so we can
|
||||
# set the new roster_version value.
|
||||
|
@ -965,7 +966,8 @@ class Logger:
|
|||
(account_jid_id, jid_id))
|
||||
self.con.commit()
|
||||
|
||||
def add_or_update_contact(self, account_jid, jid, name, sub, ask, groups):
|
||||
def add_or_update_contact(self, account_jid, jid, name, sub, ask, groups,
|
||||
commit=True):
|
||||
"""
|
||||
Add or update a contact from account_jid roster
|
||||
"""
|
||||
|
@ -996,6 +998,7 @@ class Logger:
|
|||
(account_jid_id, jid_id, name,
|
||||
self.convert_human_subscription_values_to_db_api_values(sub),
|
||||
bool(ask)))
|
||||
if commit:
|
||||
self.con.commit()
|
||||
|
||||
def get_roster(self, account_jid):
|
||||
|
|
Loading…
Reference in New Issue