mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use an LRU cache for guess_type
This commit is contained in:
parent
a700b3f19c
commit
ade0f07eac
@ -56,6 +56,7 @@ def _init_mimetypes():
|
|||||||
_mt_inited = True
|
_mt_inited = True
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache(4096)
|
||||||
def guess_type(*args, **kwargs):
|
def guess_type(*args, **kwargs):
|
||||||
import mimetypes
|
import mimetypes
|
||||||
if not _mt_inited:
|
if not _mt_inited:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user