Format code for better readability in cron job setup

This commit is contained in:
2025-07-18 23:09:04 -04:00
parent 3225ebb986
commit 46300f540d

View File

@ -1,12 +1,12 @@
import { CronJob } from 'cron'; import { CronJob } from 'cron';
import { fetchAccounts } from '$lib/simplefin'; import { fetchAccounts } from '$lib/simplefin';
import type { Handle } from "@sveltejs/kit";
const job = new CronJob( const job = new CronJob(
'10 0 * * * *', // cronTime '10 0 * * * *', // cronTime
async function () { async function () {
const statDate = Math.floor(new Date(new Date().getFullYear(), new Date().getMonth()).getTime() / 1000); const statDate = Math.floor(
new Date(new Date().getFullYear(), new Date().getMonth()).getTime() / 1000
);
const res = await fetchAccounts(startDate); const res = await fetchAccounts(startDate);
await updateAccounts(res); await updateAccounts(res);
await runRules(); await runRules();
@ -15,4 +15,3 @@ const job = new CronJob(
true, // start true, // start
'America/Detroit' // timeZone 'America/Detroit' // timeZone
); );