mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Performance improvement when updating db prefs
This commit is contained in:
parent
e16f04e7b7
commit
05cc7aa3f1
@ -49,8 +49,7 @@ class DBPrefs(dict):
|
|||||||
if self.disable_setting:
|
if self.disable_setting:
|
||||||
return
|
return
|
||||||
raw = self.to_raw(val)
|
raw = self.to_raw(val)
|
||||||
self.db.conn.execute('DELETE FROM preferences WHERE key=?', (key,))
|
self.db.conn.execute('INSERT OR REPLACE INTO preferences (key,val) VALUES (?,?)', (key,
|
||||||
self.db.conn.execute('INSERT INTO preferences (key,val) VALUES (?,?)', (key,
|
|
||||||
raw))
|
raw))
|
||||||
self.db.conn.commit()
|
self.db.conn.commit()
|
||||||
dict.__setitem__(self, key, val)
|
dict.__setitem__(self, key, val)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user