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