feat(archive): wire archive converters, validation, and extension parsing into app.js/worker.js
Also fixes a third double-extension bug the plan missed: app.js derived each job's uuid via path.basename(file.filename, path.extname(...)), which only strips the last dot segment. For a compound extension like tar.gz this left "<uuid>.tar" as the "uuid", overflowing the uuid column (Char(36)) and crashing the request. Replaced with stripExtension(). Also bumped rateLimitMaxJobs in jobs.test.js's config override — the file's cumulative POST /api/jobs calls across all tests now exceeds the production default (20/window) once the archive tests are included, causing spurious connection resets independent of any real bug. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import { registerHeicConverter } from './converters/heic.js';
|
||||
import { registerFontConverter } from './converters/font.js';
|
||||
import { registerDfontConverter } from './converters/dfont.js';
|
||||
import { registerEbookConverter } from './converters/ebook.js';
|
||||
import { registerArchiveConverters } from './converters/archive.js';
|
||||
import { findPendingJobs, markProcessing, markDone, markFailed } from './jobs/jobRepository.js';
|
||||
|
||||
const JOB_TIMEOUT_MS = 60000;
|
||||
@@ -89,6 +90,7 @@ async function main() {
|
||||
registerFontConverter();
|
||||
registerDfontConverter();
|
||||
registerEbookConverter();
|
||||
registerArchiveConverters();
|
||||
|
||||
startWorker(prisma, config);
|
||||
console.log(`Worker started, polling every ${config.workerPollIntervalMs}ms`);
|
||||
|
||||
Reference in New Issue
Block a user