Ajustes de rendering

This commit is contained in:
LeoMortari
2025-10-27 09:15:12 -03:00
parent ba768cf093
commit 8caa849148
5 changed files with 34 additions and 27 deletions

View File

@@ -70,7 +70,7 @@ class VideoPipeline:
return self._build_success_payload(context)
except Exception as exc:
logger.exception("Falha ao processar vídeo %s", context.job.filename)
return self._handle_failure(context, exc)
# return self._handle_failure(context, exc)
def _parse_job(self, message: Dict[str, Any]) -> JobMessage:
filename = message.get("filename")
@@ -200,25 +200,25 @@ class VideoPipeline:
}
def _handle_failure(self, context: PipelineContext, exc: Exception) -> Dict[str, Any]:
logger.error("Erro no pipeline: %s", exc)
cleanup_targets: List[Path] = []
logger.error("Erro na pipeline: %s", exc)
# cleanup_targets: List[Path] = []
if context.workspace:
cleanup_targets.append(context.workspace.workspace_dir)
cleanup_targets.append(context.workspace.output_dir)
original_path = context.workspace.source_path
if original_path.exists():
cleanup_targets.append(original_path)
else:
sanitized = sanitize_filename(Path(context.job.filename).stem)
job_output_dir = self.settings.outputs_dir / sanitized
if job_output_dir.exists():
cleanup_targets.append(job_output_dir)
original_path = self.settings.videos_dir / context.job.filename
if original_path.exists():
cleanup_targets.append(original_path)
# if context.workspace:
# cleanup_targets.append(context.workspace.workspace_dir)
# cleanup_targets.append(context.workspace.output_dir)
# original_path = context.workspace.source_path
# if original_path.exists():
# cleanup_targets.append(original_path)
# else:
# sanitized = sanitize_filename(Path(context.job.filename).stem)
# job_output_dir = self.settings.outputs_dir / sanitized
# if job_output_dir.exists():
# cleanup_targets.append(job_output_dir)
# original_path = self.settings.videos_dir / context.job.filename
# if original_path.exists():
# cleanup_targets.append(original_path)
remove_paths(cleanup_targets)
# remove_paths(cleanup_targets)
return {
"hasError": True,