Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

228
Vistas
Trigger Events to change database record in Node JS when reached a future dateTime

I am developing a functionality to the users where they add a task to database with DateTime field ,and when the DateTime reached it triggers event that change a filed in other table from "enabled" to "disabled" ,Plus the user can cancel this task before it happen. so how can I trigger this functionality know that my stack is , NodeJs with NestJs and Prisma ProstgreSql. i checked @nestjs/schedule and node/cron it seems it's difficult to handel task canceling or recreate the job when the server restart. any recommendation for NPM packages would be helpful.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Use NestJS lifecycle triggers like onApplicationBootstrap

  • Get closest task or bunch of tasks from DB on server run,
  • Add wait function. Like wait(task, time)
  • Execute task (Change fields by update)
  • On update callback get next task from DB and wait again

For stop execution of some DB records add boolean field like execute: false and change it by your API. On next cycle filter records by this field.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda