imageOptimizer_regenerateDocument was calling findByID / update without a
depth param, so Payload defaulted to depth:2 and recursively populated every
relation on the doc — on projects using folders, that's a full tree walk
(parent + siblings' documentsAndFolders array) per regen, adding dozens of
DB round-trips and ~4-8s per job for no benefit.
The task only reads scalar fields (mimeType, filename, url, imageOptimizer)
so depth:0 is safe. Also adds depth:0 to the catch-block error writeback
for consistency.
Diagnosed from production Vercel logs showing 12s gap between "Running 1
jobs" and the first media.update.diagnose entry.