🔨 Run once, graceful shutdown, db filename in env

- Refactored toISODateString function
- Added Db filename to env
- Added getOrDefault function for fetching envs, replaced LOG_LEVEL with getOrDefault
- Added script to run job once then exit
- Catch SIGINT signal and do a graceful shutdown
This commit is contained in:
2025-01-25 21:12:49 +01:00
parent b61903f5c8
commit 4977e7ad6a
6 changed files with 41 additions and 18 deletions

View File

@ -5,6 +5,7 @@
"main": "index.js",
"scripts": {
"start": "dotenvx run --env-file=.env.local -- node --import=tsx ./src/main.ts | pino-pretty",
"start-once": "ONCE=true dotenvx run --env-file=.env.local -- node --import=tsx ./src/main.ts | pino-pretty",
"test": "dotenvx run --env-file=.env.test.local -- node --experimental-vm-modules node_modules/jest/bin/jest.js | pino-pretty",
"format": "prettier --write \"./**/*.{js,mjs,ts,md,json}\""
},