mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Reduce file lock time
This commit is contained in:
parent
138a0338f7
commit
8921bb8324
@ -219,9 +219,9 @@ class DynamicConfig(dict):
|
|||||||
d = {}
|
d = {}
|
||||||
if os.path.exists(self.file_path):
|
if os.path.exists(self.file_path):
|
||||||
with ExclusiveFile(self.file_path) as f:
|
with ExclusiveFile(self.file_path) as f:
|
||||||
raw = f.read()
|
raw = f.read().strip()
|
||||||
try:
|
try:
|
||||||
d = cPickle.loads(raw) if raw.strip() else {}
|
d = cPickle.loads(raw) if raw else {}
|
||||||
except SystemError:
|
except SystemError:
|
||||||
pass
|
pass
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user