aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/uploads.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/uploads.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/uploads.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/uploads.py b/packages/meshbay-node/src/meshbay_node/uploads.py
index c485e39..a0f65dc 100644
--- a/packages/meshbay-node/src/meshbay_node/uploads.py
+++ b/packages/meshbay-node/src/meshbay_node/uploads.py
@@ -24,6 +24,7 @@ build first.
from __future__ import annotations
+import os
import re
import secrets
import time
@@ -31,6 +32,10 @@ from collections.abc import Iterable
from dataclasses import dataclass, field
from pathlib import Path
+from meshbay_common.paths import long_path
+
+from meshbay_node.indexer.indexer import walk_files
+
# What an unfinished upload is called on disk while it is being written. The
# node has always used this; it is named here because the reaper below has to
# recognise one, and a second spelling of it would be a bug nobody could see.
@@ -208,14 +213,14 @@ def find_parts(roots: Iterable) -> list[tuple[Path, float]]:
if not getattr(root, "available", False):
continue
try:
- candidates = root.path.rglob(f"*{PART_SUFFIX}")
+ candidates = walk_files(root.path)
except OSError:
continue
for path in candidates:
+ if not path.name.endswith(PART_SUFFIX):
+ continue
try:
- if not path.is_file():
- continue
- found.append((path, path.stat().st_mtime))
+ found.append((path, os.stat(long_path(path)).st_mtime))
except OSError:
continue
return found