5 Check Processing Status
โถStep 5: Check Processing Status
Poll until the metrics processing completes. The shed polygons are processed by the sco2 API which generates plots within each shed boundary and computes deforestation metrics.
โถWhat this step does
It reads the processing task by id
(GET /ingestions/{{shed_process_task_id}}) and checks
overall_status. The after-response script re-sends itself (3s apart, up
to 30 attempts) until the status is terminal โ here completed or
failed โ then stops. Note it polls the task minted in Step 4, not the
upload task from Step 1.
โถWhy it's needed
Plot generation and deforestation compute run in the background and take
materially longer than validation, so the results Step 6 visualises โ the
generated plots and their per-plot metrics โ do not exist until this task
reports completed. Reading the locations/metrics endpoints before then
would return an incomplete or empty picture. This poll is the gate that
guarantees the analysis has fully landed; a failed status means the
processing run did not produce metrics and Step 6 has nothing to show.
โถWhy a distinct terminal set from Step 2
Validation treats staged as a success terminal because staging is its
goal. Processing does not stop at staged โ its success terminal is
completed, when metrics have actually been written. That is why this loop
waits only for completed / failed, and why it must target
{{shed_process_task_id}}.