fix wrong position of initLogging call

This commit is contained in:
einhornimmond 2025-06-17 19:24:51 +02:00
parent 7162d39b92
commit 57bace2698
5 changed files with 6 additions and 5 deletions

View File

@ -12,7 +12,7 @@
"dev": "cross-env TZ=UTC nodemon -w src --ext ts,pug,json,css -r tsconfig-paths/register src/index.ts",
"test": "cross-env TZ=UTC NODE_ENV=development DB_DATABASE=gradido_test_backend jest --runInBand --forceExit --detectOpenHandles",
"test:coverage": "cross-env TZ=UTC NODE_ENV=development DB_DATABASE=gradido_test_backend jest --coverage --runInBand --forceExit --detectOpenHandles",
"seed": "cross-env TZ=UTC NODE_ENV=development ts-node -r tsconfig-paths/register src/seeds/index.ts",
"seed": "cross-env TZ=UTC NODE_ENV=development DB_DATABASE=gradido_test_backend ts-node -r tsconfig-paths/register src/seeds/index.ts",
"klicktipp": "cross-env TZ=UTC NODE_ENV=development ts-node -r tsconfig-paths/register src/util/executeKlicktipp.ts",
"gmsusers": "cross-env TZ=UTC NODE_ENV=development ts-node -r tsconfig-paths/register src/apis/gms/ExportUsers.ts",
"humhubUserExport": "cross-env TZ=UTC NODE_ENV=development ts-node -r tsconfig-paths/register src/apis/humhub/ExportUsers.ts",

View File

@ -19,6 +19,7 @@ CONFIG.EMAIL = false
const forceMode = process.argv.includes('--force')
async function main() {
initLogging()
// open mysql connection
const con = AppDatabase.getInstance()
await con.init()
@ -74,7 +75,6 @@ async function main() {
}
main().catch((e) => {
initLogging()
logger.error(e)
process.exit(1)
})

View File

@ -62,7 +62,7 @@ async function loadUsersFromHumHub(client: HumHubClient): Promise<Map<string, Ge
async function main() {
const start = new Date().getTime()
initLogging()
// open mysql connection
const con = AppDatabase.getInstance()
await con.init()
@ -116,7 +116,6 @@ async function main() {
}
main().catch((e) => {
initLogging()
logger.error(e)
process.exit(1)
})

View File

@ -50,6 +50,7 @@ const resetEntity = async (entity: any) => {
}
const run = async () => {
initLogging()
const server = await createServer(getLogger('apollo'), context)
const seedClient = createTestClient(server.apollo)
const { con } = server
@ -99,7 +100,6 @@ const run = async () => {
}
run().catch((err) => {
initLogging()
// biome-ignore lint/suspicious/noConsole: no logger present
console.error('error on seeding', err)
})

View File

@ -1,8 +1,10 @@
import { AppDatabase } from 'database'
import { exportEventDataToKlickTipp } from './klicktipp'
import { initLogging } from '@/server/logger'
async function executeKlicktipp(): Promise<boolean> {
initLogging()
const connection = AppDatabase.getInstance()
await connection.init()
if (connection.isConnected()) {