fix: Remove .env copy and fix TypeScript errors in worker build
All checks were successful
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s

This commit is contained in:
Ahmed Darrazi 2025-12-09 13:38:13 +01:00
parent cd2abed1ab
commit 51a76ef944
3 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,6 @@ import { getUserAuth } from '@/lib/auth/utils';
import { eq, ilike, or, desc, and, ne, isNotNull } from 'drizzle-orm';
import { env } from '@/lib/env.mjs';
import { syncQueue } from '@/lib/queue/syncQueue';
import { syncQueue } from '@/lib/queue/syncQueue';
export interface PolicySettingSearchResult {
id: string;

View File

@ -25,7 +25,6 @@ RUN npm ci --production --silent
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/worker ./worker
COPY --from=builder /usr/src/app/lib ./lib
COPY --from=builder /usr/src/app/.env* ./ || true
ENV NODE_ENV=production

View File

@ -5,15 +5,17 @@ const jobStartTimes = new Map<string | number, number>();
export function attachWorkerEvents(worker: Worker) {
worker.on('active', (job: Job) => {
jobStartTimes.set(job.id, Date.now());
logger.info({ event: 'job_active', jobId: job.id, name: job.name, data: job.data });
const jobId = job.id?.toString() || 'unknown';
jobStartTimes.set(jobId, Date.now());
logger.info({ event: 'job_active', jobId, name: job.name, data: job.data });
});
worker.on('completed', (job: Job) => {
const start = jobStartTimes.get(job.id) || Date.now();
const jobId = job.id?.toString() || 'unknown';
const start = jobStartTimes.get(jobId) || Date.now();
const durationMs = Date.now() - start;
jobStartTimes.delete(job.id);
logger.info({ event: 'job_complete', jobId: job.id, durationMs, timestamp: new Date().toISOString() });
jobStartTimes.delete(jobId);
logger.info({ event: 'job_complete', jobId, durationMs, timestamp: new Date().toISOString() });
});
worker.on('failed', (job: Job | undefined, err: Error | undefined) => {