appKom / online-opptak

Opptakssystem for komitésøkere i linjeforeningen Online.
https://opptak.online.ntnu.no/
5 stars 3 forks source link

Make matching algorithm run at end of application-period #140

Open julian-ao opened 1 month ago

julian-ao commented 1 month ago

Can either use cron jobs (https://www.npmjs.com/package/node-cron) or setTimeout:

const executeTask = () => {
  console.log('Task executed');
};

const scheduleTask = (date) => {
  const now = new Date();
  const delay = date.getTime() - now.getTime();

  if (delay > 0) {
    setTimeout(executeTask, delay);
  }
};

const specificDate = new Date('2024-07-20T14:30:00'); // Specify the date and time
scheduleTask(specificDate);
jorgengaldal commented 1 month ago

Make a Python script that: