From df896a8f0ef568d819690f96c679358c8f9ce723 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Tue, 21 Oct 2025 10:07:34 +0100 Subject: [PATCH] Remove email reporting except between May - September --- auto-report-mail/index.js | 6 +++--- src/reports/reports.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/auto-report-mail/index.js b/auto-report-mail/index.js index 9c4c828..54bac2e 100644 --- a/auto-report-mail/index.js +++ b/auto-report-mail/index.js @@ -53,7 +53,7 @@ export async function sendReportEmail(start, end, subject = "TrACreport Summary" } // Daily Report -cron.schedule('5 1 * * *', () => { +cron.schedule('5 1 * 5,6,7,8,9 *', () => { const today = new Date(); const yesterday = new Date(today); yesterday.setUTCDate(today.getUTCDate() - 1); @@ -61,7 +61,7 @@ cron.schedule('5 1 * * *', () => { }); // Weekly Report -cron.schedule('10 1 * * 1', () => { +cron.schedule('10 1 * 5,6,7,8,9 1', () => { const today = new Date(); const end = new Date(today); end.setUTCDate(today.getUTCDate() - 1); @@ -71,7 +71,7 @@ cron.schedule('10 1 * * 1', () => { }) // Monthly Report -cron.schedule('15 1 1 * *', () => { +cron.schedule('15 1 1 5,6,7,8,9 *', () => { const today = new Date(); const end = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), 0)); // Last day of previous month const start = new Date(Date.UTC(end.getUTCFullYear(), end.getUTCMonth(), 1)); // First day of previous month diff --git a/src/reports/reports.ts b/src/reports/reports.ts index 77589c8..3f44025 100644 --- a/src/reports/reports.ts +++ b/src/reports/reports.ts @@ -1,5 +1,4 @@ import { generateHTMLReport } from "./reportHtml.js"; -import { writeFile } from "fs/promises"; import { fetchReportsInRange } from "../models/report.js"; export interface BaseReport {