缓存功能windows平台适配
This commit is contained in:
1 parent
151e6e4b97
commit
22579e51c9
8 files changed
+333
-1
No files matched your search
@@ -218,7 +218,13 @@ def touch_cache_entry(cache_dir: Path, kind: str, key: str) -> None:
|
||||
entry = cache / kind / key
|
||||
_require_directory(entry)
|
||||
# Directory mtime is separate from the checksummed artifact/manifest bytes.
|
||||
os.utime(entry, None, follow_symlinks=False)
|
||||
# Windows Python may expose utime without the no-follow operation. The
|
||||
# checks above reject symlinks and reparse points before either call, and
|
||||
# the caller's use lease protects the entry from application eviction.
|
||||
if os.utime in os.supports_follow_symlinks:
|
||||
os.utime(entry, None, follow_symlinks=False)
|
||||
else:
|
||||
os.utime(entry, None)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
||||
Reference in new issue
Block a user