LogReader: cache internal source available (#35761)

* cache

* fix

* match behavioir
pull/35763/head
Shane Smiskol 6 days ago committed by GitHub
parent 278781e5af
commit fbbad834f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      tools/lib/filereader.py

@ -2,6 +2,7 @@ import os
import posixpath import posixpath
import socket import socket
from functools import cache from functools import cache
from openpilot.common.retry import retry
from urllib.parse import urlparse from urllib.parse import urlparse
from openpilot.tools.lib.url_file import URLFile from openpilot.tools.lib.url_file import URLFile
@ -9,6 +10,8 @@ from openpilot.tools.lib.url_file import URLFile
DATA_ENDPOINT = os.getenv("DATA_ENDPOINT", "http://data-raw.comma.internal/") DATA_ENDPOINT = os.getenv("DATA_ENDPOINT", "http://data-raw.comma.internal/")
@cache
@retry(delay=0.0)
def internal_source_available(url: str) -> bool: def internal_source_available(url: str) -> bool:
if os.path.isdir(url): if os.path.isdir(url):
return True return True

Loading…
Cancel
Save