Added:
- CronJob - interface and simple impl for Actual - interface and simple impl for Sparebank1 - Mappings between sparebank1 transactions and actual transactions - Requires type keyword on type imports
This commit is contained in:
15
src/cron.ts
15
src/cron.ts
@ -0,0 +1,15 @@
|
||||
import { CronJob } from "cron"
|
||||
|
||||
/**
|
||||
* Run a function every day at 1 AM, Oslo time.
|
||||
* @param onTick Function to run.
|
||||
* @returns CronJob instance.
|
||||
*/
|
||||
export function cronJobDaily(onTick: () => Promise<void>): CronJob {
|
||||
return CronJob.from({
|
||||
cronTime: "0 0 1 * * *",
|
||||
onTick,
|
||||
start: true,
|
||||
timeZone: "Europe/Oslo",
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user