fix: fixed CSM-014

This commit is contained in:
2026-05-09 16:38:00 +02:00
parent 1beffe6b07
commit de7ea12c9c
4 changed files with 33 additions and 19 deletions

View File

@@ -120,11 +120,13 @@ defmodule BDS.Publishing do
defp run_upload(job_id, credentials, targets, uploader, report) do
update_job(job_id, %{status: :running, error: nil})
target_count = max(length(targets), 1)
result =
Enum.with_index(targets, 1)
|> Enum.reduce_while(:ok, fn {target, index}, :ok ->
files = list_target_files(target)
report.(index / max(length(targets), 1), "Uploading #{target.kind}")
report.(index / target_count, "Uploading #{target.kind}")
case uploader.(target, files, credentials) do
:ok -> {:cont, :ok}