Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
🐛 Updated sqlite to have one connection per db
Browse files Browse the repository at this point in the history
  • Loading branch information
vardan10 committed Oct 19, 2023
1 parent 64497d7 commit a3091d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion framework/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lisk-service-framework",
"version": "1.6.0",
"version": "1.6.1",
"description": "Lisk Service Framework",
"keywords": [
"lisk",
Expand Down
6 changes: 3 additions & 3 deletions framework/src/database/sqlite3.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ const createDBConnection = async (dbDataDir, tableName) => {
};

const getDBConnection = async (tableName, dbDataDir) => {
if (!connectionPool[tableName]) {
if (!connectionPool[dbDataDir]) {
if (!(await exists(dbDataDir))) {
await mkdir(dbDataDir, { recursive: true });
}
connectionPool[tableName] = await createDBConnection(dbDataDir, tableName);
connectionPool[dbDataDir] = await createDBConnection(dbDataDir, tableName);
}

const knex = connectionPool[tableName];
const knex = connectionPool[dbDataDir];
return knex;
};

Expand Down

0 comments on commit a3091d2

Please sign in to comment.