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