api: serve PDFs — extraction in the child under the pool, full text or map, errors
Route "pdf" through clean.Kind in doFetch/cleanFetched: extract under the pool (keyed by caller class + document hash, one per caller), map the five pdftext errors plus a pool panic to 422, ErrBusy to 503+Retry-After 10, ErrCallerBusy to 429, and answer with the whole text or the map. Adds RetryAfter to fetch.Error and the matching header. No cache, pages or grep — those are task 07. Co-Authored-By: ornith-1.5-35b-a3b <ornith-1.5-35b-a3b@llama.cpp.invalid>
This commit is contained in:
@@ -43,9 +43,10 @@ func (r *Resource) SHA256() string {
|
||||
|
||||
// Error is a fetch failure with the HTTP status sift should return to its caller.
|
||||
type Error struct {
|
||||
Status int
|
||||
Msg string
|
||||
Hint string
|
||||
Status int
|
||||
Msg string
|
||||
Hint string
|
||||
RetryAfter int // seconds to wait before retrying; 0 = none
|
||||
}
|
||||
|
||||
func (e *Error) Error() string { return e.Msg }
|
||||
|
||||
Reference in New Issue
Block a user