Refactor API and worker applications to streamline middleware imports and remove unused Redis dependency. Update TypeScript build information across packages to reflect recent changes in file structure and dependencies.
Some checks failed
CI / Node — lint, typecheck, test, build (push) Failing after 9s
CI / Go — node-agent tests (push) Failing after 22s
CI / Go — edge-gateway build (push) Successful in 13s

This commit is contained in:
smueller
2026-06-26 10:53:55 +02:00
parent 9e1c7840d1
commit e25e871067
12 changed files with 14 additions and 26 deletions

View File

@@ -15,7 +15,6 @@
"@hexahost/config": "workspace:*",
"@hexahost/database": "workspace:*",
"bullmq": "^5.34.10",
"ioredis": "^5.4.2",
"pino": "^9.6.0"
},
"devDependencies": {

View File

@@ -1,5 +1,4 @@
import { Job, Worker, type ConnectionOptions } from 'bullmq';
import IORedis from 'ioredis';
import { validateConfig } from '@hexahost/config';
import { prisma } from '@hexahost/database';
@@ -8,12 +7,6 @@ import { startHealthServer } from './health';
import { logger } from './logger';
import { WORKER_QUEUES, type WorkerQueueName } from './queues';
function createRedisConnection(redisUrl: string): IORedis {
return new IORedis(redisUrl, {
maxRetriesPerRequest: null,
});
}
function createQueueWorker(
queueName: WorkerQueueName,
connection: ConnectionOptions,
@@ -36,9 +29,13 @@ async function bootstrap(): Promise<void> {
const config = validateConfig();
const healthServer = startHealthServer();
const redis = createRedisConnection(config.REDIS_URL);
const connection: ConnectionOptions = {
url: config.REDIS_URL,
maxRetriesPerRequest: null,
};
const workers = WORKER_QUEUES.map((queueName) =>
createQueueWorker(queueName, redis),
createQueueWorker(queueName, connection),
);
for (const worker of workers) {
@@ -60,7 +57,6 @@ async function bootstrap(): Promise<void> {
logger.info({ signal }, 'Shutting down worker');
await Promise.all(workers.map((worker) => worker.close()));
await redis.quit();
await prisma.$disconnect();
healthServer.close(() => {

File diff suppressed because one or more lines are too long