mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ensure only one thread can run the update function for mobileread.
This commit is contained in:
parent
07f0209fc6
commit
4ddc69e0a6
@ -10,6 +10,7 @@ import difflib
|
|||||||
import heapq
|
import heapq
|
||||||
import time
|
import time
|
||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
|
from threading import RLock
|
||||||
|
|
||||||
from lxml import html
|
from lxml import html
|
||||||
|
|
||||||
@ -25,6 +26,7 @@ class MobileReadStore(StorePlugin):
|
|||||||
|
|
||||||
def genesis(self):
|
def genesis(self):
|
||||||
self.config = DynamicConfig('store_' + self.name)
|
self.config = DynamicConfig('store_' + self.name)
|
||||||
|
self.rlock = RLock()
|
||||||
|
|
||||||
def open(self, parent=None, detail_item=None, external=False):
|
def open(self, parent=None, detail_item=None, external=False):
|
||||||
url = 'http://www.mobileread.com/'
|
url = 'http://www.mobileread.com/'
|
||||||
@ -60,6 +62,7 @@ class MobileReadStore(StorePlugin):
|
|||||||
yield s
|
yield s
|
||||||
|
|
||||||
def update_book_list(self, timeout=10):
|
def update_book_list(self, timeout=10):
|
||||||
|
with self.rlock:
|
||||||
url = 'http://www.mobileread.com/forums/ebooks.php?do=getlist&type=html'
|
url = 'http://www.mobileread.com/forums/ebooks.php?do=getlist&type=html'
|
||||||
|
|
||||||
last_download = self.config.get(self.name + '_last_download', None)
|
last_download = self.config.get(self.name + '_last_download', None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user