Cache get
This commit is contained in:
parent
286d2c0893
commit
5a4adc43fe
1 changed files with 2 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
|
from functools import lru_cache
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from types import TracebackType
|
from types import TracebackType
|
||||||
from typing import IO, Any, List, Optional, Type, Union, cast
|
from typing import IO, Any, List, Optional, Type, Union, cast
|
||||||
|
|
@ -141,6 +142,7 @@ class LargeFile(ABC):
|
||||||
def version(self) -> int:
|
def version(self) -> int:
|
||||||
return cast(int, self._version)
|
return cast(int, self._version)
|
||||||
|
|
||||||
|
@lru_cache(1)
|
||||||
def get(self, hide_progress: bool = False) -> Path:
|
def get(self, hide_progress: bool = False) -> Path:
|
||||||
remote_path = next(
|
remote_path = next(
|
||||||
i.remote_path for i in self._instances if i.version == self._version
|
i.remote_path for i in self._instances if i.version == self._version
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue