End to end on the workstation (coordinator:run, the API, edge:node, real NNTP): a.b.e-book.french and a.b.cd.image.playstation2.dvdiso ranges. - Prefetcher: every connection takes the next missing chunk (leased ranges first, in order); one connection per range (~26k lines/s) kept the worker waiting - executable rule: releases of bare executables (malware floods named after films and software) are dropped; they were 92% of the catalog rows of the test ranges, 21% of the segments - fragments per file (details once) and gzipped batch bodies; the JSON limit (1 MB by default) raised to 256 MB, empty strings kept (a rule count's key is '') - release_chunks.batch_from is a bigint (boneless article numbers) - tests get their own database; edge:bench --store times BatchStore: 1.3 s for a boneless range (1.24 ms per release chunk) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
80 lines
1.8 KiB
TypeScript
80 lines
1.8 KiB
TypeScript
import { defineConfig } from '@adonisjs/core/bodyparser'
|
|
|
|
const bodyParserConfig = defineConfig({
|
|
/**
|
|
* Parse request bodies for these HTTP methods.
|
|
* Keep this aligned with methods that receive payloads in your routes.
|
|
*/
|
|
allowedMethods: ['POST', 'PUT', 'PATCH', 'DELETE'],
|
|
|
|
/**
|
|
* Config for the "application/x-www-form-urlencoded"
|
|
* content-type parser.
|
|
*/
|
|
form: {
|
|
/**
|
|
* Normalize empty string values to null.
|
|
*/
|
|
convertEmptyStringsToNull: true,
|
|
|
|
/**
|
|
* Content types handled by the form parser.
|
|
*/
|
|
types: ['application/x-www-form-urlencoded'],
|
|
},
|
|
|
|
/**
|
|
* Config for the JSON parser.
|
|
*/
|
|
json: {
|
|
// Edge worker batches carry their releases' chunks (base64) and edge fragments; the limit is on the inflated body.
|
|
limit: '256mb',
|
|
|
|
// Workers send '' on purpose (e.g. a rule count's key); null would break NOT NULL columns.
|
|
convertEmptyStringsToNull: false,
|
|
|
|
/**
|
|
* Content types handled by the JSON parser.
|
|
*/
|
|
types: [
|
|
'application/json',
|
|
'application/json-patch+json',
|
|
'application/vnd.api+json',
|
|
'application/csp-report',
|
|
],
|
|
},
|
|
|
|
/**
|
|
* Config for the "multipart/form-data" content-type parser.
|
|
* File uploads are handled by the multipart parser.
|
|
*/
|
|
multipart: {
|
|
/**
|
|
* Automatically process uploaded files into the system tmp directory.
|
|
*/
|
|
autoProcess: true,
|
|
|
|
/**
|
|
* Normalize empty string values to null.
|
|
*/
|
|
convertEmptyStringsToNull: true,
|
|
|
|
/**
|
|
* Routes where multipart processing is handled manually.
|
|
*/
|
|
processManually: [],
|
|
|
|
/**
|
|
* Maximum accepted payload size for multipart requests.
|
|
*/
|
|
limit: '20mb',
|
|
|
|
/**
|
|
* Content types handled by the multipart parser.
|
|
*/
|
|
types: ['multipart/form-data'],
|
|
},
|
|
})
|
|
|
|
export default bodyParserConfig
|