Skip to content

Feature set 126. - #53

Merged
jackfperryjr merged 1 commit into
mainfrom
features-126
Aug 3, 2026
Merged

Feature set 126.#53
jackfperryjr merged 1 commit into
mainfrom
features-126

Conversation

@jackfperryjr

Copy link
Copy Markdown
Owner

Saves generated image URLs as the batch runs instead of once at the end.

GenerateAsync collected every result in memory and wrote them all in a single
SaveChangesAsync after the last image. A 400-image run on 2026-08-03 took close to the
runner''s six-hour timeout-minutes ceiling, and anything killed at that ceiling loses the
GeneratedImageUrl for every image it had already generated, paid for and uploaded.

No money was ever at risk — object keys derive from the row id, so a later run finds the art
already at its final address and adopts it back for free. But recovering bookkeeping that was
already done costs an entire extra run against a daily quota of 1,000 requests.

Results now queue and drain to the database every 25 rows, capping the loss at the last partial
group. The flush is serialised behind its own gate rather than relying on the worker semaphore
being set to a concurrency of one, so raising that later cannot quietly introduce a race on the
non-thread-safe DbContext. The trailing flush after the batch keeps the existing behaviour of
recording work the daily quota cut short.

Release notes

  • Image generation now records progress to the database every 25 images rather than only at the
    end, so a batch stopped by the job timeout keeps the work it has already done.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jackfperryjr
jackfperryjr merged commit 36e925a into main Aug 3, 2026
1 check passed
@jackfperryjr
jackfperryjr deleted the features-126 branch August 3, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant