- Moved database to subdir specified by env - Default data dir /data - Move loggers to cronJob onTick - Added volume for data dir in Docker compose - Create any missing dir specified by env
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { CronJob } from "cron"
|
||||
import logger from "@/logger.ts"
|
||||
|
||||
/**
|
||||
* Run a function every day at 1 AM, Oslo time.
|
||||
@ -8,7 +9,11 @@ import { CronJob } from "cron"
|
||||
export function cronJobDaily(onTick: () => Promise<void>): CronJob {
|
||||
return CronJob.from({
|
||||
cronTime: "0 0 1 * * *",
|
||||
onTick,
|
||||
onTick: async () => {
|
||||
logger.info("Starting daily job")
|
||||
await onTick()
|
||||
logger.info("Finished daily job")
|
||||
},
|
||||
start: true,
|
||||
timeZone: "Europe/Oslo",
|
||||
})
|
||||
|
Reference in New Issue
Block a user