a7340eed

By: Michael Lynch <git@mtlynch.io>

Make NewUploadPath own temp-file creation

NewUploadPath took an already-built path string, but its only caller
always passed os.CreateTemp's own output, so its empty/"/" checks
guarded against a state that could never occur. That validation only
existed to make the zero value double as a "not yet set" sentinel in
parseVideoUploadPostRequest, which repeatedly checked
tmpPath.String() != "" instead of the type representing optionality
itself.

NewUploadPath now takes an io.Reader and performs the
CreateTemp/Copy/Close sequence itself (absorbing handlers.copyToTempFile),
so a successfully constructed UploadPath is real proof a fully-written
temp file exists. parseVideoUploadPostRequest now tracks "not yet set"
with a *UploadPath instead of an empty-string convention.

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 2s 4s 4s 7s 2s
Eval 7s 1m31s 1m31s 1m39s 0s
Build 1m38s 5m09s 2m12s 3m51s 13s
Suite 2s 6m46s 3m48s 3m51s 16s

Timeline

0s20s40s1m1m20s2m2m20s2m40s3m3m20s