close database connection

This commit is contained in:
Ulf Gebhardt 2025-04-27 13:57:28 +02:00
parent f14bc3ecf0
commit 98d33f1101
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -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()
})()