🐋 Docker volume for Sqlite
Some checks failed
Deploy application / deploy (push) Failing after 7s

- 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:
2025-01-26 19:29:43 +01:00
parent aaa85e99cb
commit 9850017e3a
8 changed files with 34 additions and 23 deletions

View File

@ -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",
})