From 21dbb4f9600858c22bf4a781ce2c80e6bf95f946 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Wed, 14 May 2025 18:43:30 -0600 Subject: [PATCH] fix cronworker y conexion prisma api --- api/server.js | 2 +- worker/cron-worker.js | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/api/server.js b/api/server.js index 5cacc62..06cdcdb 100644 --- a/api/server.js +++ b/api/server.js @@ -1,6 +1,6 @@ // planilla/api/server.js import express from 'express'; -import { PrismaClient } from '@prisma/client'; +import { PrismaClient } from 'prisma/generated/prisma/client'; const prisma = new PrismaClient(); const app = express(); diff --git a/worker/cron-worker.js b/worker/cron-worker.js index f418590..ca938b3 100644 --- a/worker/cron-worker.js +++ b/worker/cron-worker.js @@ -1,16 +1,11 @@ -//cron-worker.js just prints the current date and time every 5 seconds - import cron from 'node-cron'; cron.schedule('*/5 * * * * *', () => { const now = new Date(); if (!isNaN(now)) { - const formatted = new Intl.DateTimeFormat('es-HN', { - dateStyle: 'full', - timeStyle: 'medium', - timeZone: 'America/Tegucigalpa', - }).format(now); + const formatted = now.toISOString(); // ✅ siempre funciona, sin locales console.log('[cron]', formatted); + } else { + console.log('[cron] Fecha inválida'); } }); -