check / check (push) Waiting to run
The hand-written time limit middleware answered 408 and wrote that answer from its own goroutine while the handler could still be writing. It is replaced by chi's middleware.Timeout, placed after JSONResponseMiddleware so its 504 is not lost behind a 200. After a database read or other lookup, a handler asks deadlinePassed whether the request's time limit passed and, if so, answers 504 instead of its 500, 404 or partial result: the AS and prefix reads, cut off while reading rows, return part of them, or none, without an error. JSONValidationMiddleware answers 504 with the JSON error body when the limit has passed and the handler wrote nothing. status.json and /api/v1/stats answer 504 when their 4-second database read runs out. Model: opus-5-5