Skip to content

Commit 5a65d66

Browse files
kukoveczqkaiser
authored andcommitted
fix(reporting): Add StatReport for every Task
Unblob should produce a StatReport for every Task which it needs to handle. Currently it does not do it in 2 cases: 1. When the max depth limit is reached 2. When the to-be-processed file's path is considered invalid In both cases it would be nice to see the actual report of the not-processed file(s).
1 parent 1f6ab0a commit 5a65d66

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

unblob/processing.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ def _process_error(self, result: TaskResult, exc: Exception):
235235
logger.exception("Unknown error happened", exc_info=exc)
236236

237237
def _process_task(self, result: TaskResult, task: Task):
238+
stat_report = StatReport.from_path(task.path)
239+
result.add_report(stat_report)
238240
log = logger.bind(path=task.path)
239241

240242
if task.depth >= self._config.max_depth:
@@ -246,9 +248,6 @@ def _process_task(self, result: TaskResult, task: Task):
246248
log.warning("Path contains invalid characters, it won't be processed")
247249
return
248250

249-
stat_report = StatReport.from_path(task.path)
250-
result.add_report(stat_report)
251-
252251
if stat_report.is_dir:
253252
log.debug("Found directory")
254253
for path in task.path.iterdir():

0 commit comments

Comments
 (0)