feat: sync latest ARR implementation
This commit is contained in:
@@ -164,6 +164,26 @@ class MonthlyReportService:
|
||||
reservation: Optional[ReservedReport] = None
|
||||
try:
|
||||
reservation = self._repository.reserve_report(report)
|
||||
if reservation.already_published:
|
||||
artifact = reservation.published_artifact
|
||||
if artifact is None:
|
||||
raise RepositoryError(
|
||||
ErrorCode.PUBLISH_FAILED,
|
||||
"published monthly artifact identity is missing",
|
||||
)
|
||||
return RunResult(
|
||||
request=request,
|
||||
status="success",
|
||||
row_count=report.row_count,
|
||||
channel_manifest=report.channel_manifest,
|
||||
report_version_id=reservation.report_version_id,
|
||||
version_no=reservation.version_no,
|
||||
artifact={
|
||||
"filename": artifact.original_filename,
|
||||
"storage_key": artifact.storage_key,
|
||||
"sha256": artifact.sha256,
|
||||
},
|
||||
)
|
||||
with private_staging_directory(self._staging_root) as temp_dir:
|
||||
work_dir = Path(temp_dir)
|
||||
built = self._builder.build(report, work_dir)
|
||||
|
||||
Reference in New Issue
Block a user