Skip to content

Commit 0ef99ce

Browse files
bug - cache config
1 parent 33dce32 commit 0ef99ce

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export interface IConfig {
2626
transactionDb: string;
2727
transactionHistoryDb: string;
2828
dbCertPath: string;
29+
cacheEnabled: boolean;
30+
cacheTTL: number;
2931
};
3032
logger: {
3133
logstashHost: string;
@@ -51,6 +53,8 @@ export const configuration: IConfig = {
5153
transactionHistoryDb: process.env.TRANSACTION_HISTORY_DB as string,
5254
transactionDb: process.env.TRANSACTION_DB as string,
5355
dbCertPath: process.env.DATABASE_CERT_PATH as string,
56+
cacheEnabled: process.env.CACHE_ENABLED === 'true',
57+
cacheTTL: parseInt(process.env.CACHE_TTL!, 10),
5458
},
5559
env: process.env.NODE_ENV as string,
5660
logger: {

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const databaseManagerConfig = {
1919
password: configuration.db.password,
2020
url: configuration.db.url,
2121
user: configuration.db.user,
22+
localCacheEnabled: configuration.db.cacheEnabled,
23+
localCacheTTL: configuration.db.cacheTTL,
2224
},
2325
transaction: configuration.db.transactionDb
2426
? {

0 commit comments

Comments
 (0)