fix: reduce max dither dimension to 512px for CF timeout compliance

1024px still took 35s for error diffusion. 512px should be ~4x faster.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-16 16:45:12 -07:00
parent f3684c1467
commit ef696f498a
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ from app.schemas.dither import DitherAlgorithm, PaletteMode
logger = logging.getLogger(__name__)
# Max dimension for dithering input — keeps processing under Cloudflare timeout
_MAX_DITHER_DIM = 1024
_MAX_DITHER_DIM = 512
# In-memory cache: sha256(slug+params) → (png_bytes, metadata)
_MAX_CACHE = 200