Wire the app, worker, and cleanup entry points onto Prisma Client

Task 4 rewrote src/db.js and src/jobs/jobRepository.js to use Prisma
instead of the hand-rolled mariadb pool. This updates every remaining
call site (app.js, server.js, worker.js, cleanup.js) and the 5 test
files that still referenced getPool/closePool/pool.query, so the app
and full test suite compile and run against Prisma Client.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 01:32:54 +02:00
co-authored by Claude Sonnet 5
parent 3a04da3180
commit 4c9fe8f616
9 changed files with 93 additions and 93 deletions
+4 -4
View File
@@ -31,7 +31,7 @@ function registerAllConverters() {
convertersRegistered = true;
}
export function createApp(config, pool) {
export function createApp(config, prisma) {
registerAllConverters();
const app = express();
@@ -131,7 +131,7 @@ export function createApp(config, pool) {
}
const expiresAt = new Date(Date.now() + config.retentionHours * 3600 * 1000);
await createJob(pool, {
await createJob(prisma, {
uuid,
family: registryEntry.family,
sourceFormat,
@@ -151,7 +151,7 @@ export function createApp(config, pool) {
});
app.get('/api/jobs/:id', async (req, res) => {
const job = await getJobByUuid(pool, req.params.id);
const job = await getJobByUuid(prisma, req.params.id);
if (!job) {
return res.status(404).json({ error: 'Job not found' });
}
@@ -173,7 +173,7 @@ export function createApp(config, pool) {
}
app.get('/api/jobs/:id/download', async (req, res) => {
const job = await getJobByUuid(pool, req.params.id);
const job = await getJobByUuid(prisma, req.params.id);
if (!job) {
return res.status(404).json({ error: 'Job not found' });
}