Make Your Tasks Rerun-Safe

🔴 Red sticky = I need help. Put it up the moment you are stuck — an instructor will come to you.

🟢 Green sticky = I have done 1–4 and am moving on to the bonus work, and I am ready to help my table.

Day 2 arc — you are on step 5, scale (Part 2). profile document submit read logs scale (Part 2) debug 1 2 3 4 5

Everything on this page runs from your clone, with the environment active:

cd ~/yens-onboarding-2026
source .venv/bin/activate

Task: Make each array task skip work it has already done, then resubmit the same array and watch it finish in seconds.

A handful of your 100 will come back empty sooner or later — a node reboots, a task hits its time limit, the API times out. Rerunning the whole array to catch them wastes compute and, with a paid API, money.

Add the existence check to your script, then resubmit the array you just ran.

💡 Hint — one way to do it
# already done? skip — makes the array safe to resubmit after a partial failure
if output_path.exists():
    print(f"{output_path} already exists — skipping")
    sys.exit(0)

Nothing has been deleted, so every task should find its output and exit at once — the whole array finishing in seconds rather than minutes is the sign it worked.


Page last modified: Sep 15, 2026.

Your details

Set these once and the commands on every page fill themselves in. Stored in this browser.

Built with Just the Docs.