fix: Use lru_cache instead of cache
* Mainly because it was introduced in PY39 * Making this change beacuse I'd like to evict cold caches too
This commit is contained in:
parent
3674117192
commit
001075f88a
1 changed files with 2 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ import json
|
|||
import mimetypes
|
||||
import os
|
||||
import re
|
||||
from functools import cache, wraps
|
||||
from functools import lru_cache, wraps
|
||||
from typing import Dict, Optional
|
||||
|
||||
import yaml
|
||||
|
|
@ -512,7 +512,7 @@ def add_preload_headers(response):
|
|||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
@cache
|
||||
@lru_cache()
|
||||
def is_binary_file(path):
|
||||
# ref: https://stackoverflow.com/a/7392391/10309266
|
||||
textchars = bytearray({7,8,9,10,12,13,27} | set(range(0x20, 0x100)) - {0x7f})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue