Skip to content
Snippets Groups Projects
Commit 620ab33e authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Handle broken links in uploads. [skip ci]

parent 8419d02d
Branches
Tags
1 merge request!37Migration
Pipeline #45868 skipped
......@@ -273,7 +273,13 @@ class Package(Document):
# if an upload has more then 1000 files, its pretty likely that
# size patterns repeat ... goood enough
if len(stats) < use_stats_for_filestats_threshold:
try:
filesize = os.path.getsize(filepath)
except Exception:
# if there are individual files that cannot be accessed, we fully ignore them
# they are most likely just broken links
pass
stats.push(filesize)
else:
filesize = stats.mean()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment