mirror of
https://github.com/taoky/shadowmire.git
synced 2025-07-08 17:32:43 +00:00
Only do one stat() for packages when sync-packages is on in verification step 3
Related: #4
This commit is contained in:
parent
f4927fdb0d
commit
d64ea61be7
@ -556,12 +556,14 @@ class SyncBase:
|
|||||||
should_update = False
|
should_update = False
|
||||||
for href, size in hrefsize_json:
|
for href, size in hrefsize_json:
|
||||||
dest = Path(normpath(package_simple_path / href))
|
dest = Path(normpath(package_simple_path / href))
|
||||||
if not dest.exists():
|
try:
|
||||||
|
dest_stat = dest.stat()
|
||||||
|
except FileNotFoundError:
|
||||||
logger.info("add %s as it's missing packages", package_name)
|
logger.info("add %s as it's missing packages", package_name)
|
||||||
should_update = True
|
should_update = True
|
||||||
break
|
break
|
||||||
if compare_size and size != -1:
|
if compare_size and size != -1:
|
||||||
dest_size = dest.stat().st_size
|
dest_size = dest_stat.st_size
|
||||||
if dest_size != size:
|
if dest_size != size:
|
||||||
logger.info(
|
logger.info(
|
||||||
"add %s as its local size %s != %s",
|
"add %s as its local size %s != %s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user