From 98d33f11015e3a74ca7dd64aeeb2c8d1efc99c89 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sun, 27 Apr 2025 13:57:28 +0200 Subject: [PATCH] close database connection --- backend/src/db/data-branding.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/src/db/data-branding.ts b/backend/src/db/data-branding.ts index e9af41840..073ebafe0 100644 --- a/backend/src/db/data-branding.ts +++ b/backend/src/db/data-branding.ts @@ -6,11 +6,14 @@ import { readdir } from 'node:fs/promises' import path from 'node:path' +import { getNeode } from './neo4j' + const dataFolder = path.join(__dirname, 'data/') +const neode = getNeode() ;(async function () { const files = await readdir(dataFolder) - files.forEach(async (file) => { + for await (const file of files) { if (file.slice(0, -3).endsWith('-branding')) { const importedModule = await import(path.join(dataFolder, file)) if (!importedModule.default) { @@ -18,5 +21,8 @@ const dataFolder = path.join(__dirname, 'data/') } await importedModule.default() } - }) + } + + // close database connection + neode.close() })()