forked from mito-systems/sol-mem-gen
Take database path from env
This commit is contained in:
parent
d87a6729c5
commit
911240877f
@ -26,3 +26,5 @@ WSOL_MINT_ADDRESS=So11111111111111111111111111111111111111112
|
||||
WSOL_LOCK_DURATION_IN_SECONDS=172800 # 48 hours
|
||||
REWARD_MULTIPLIER=4
|
||||
MAX_RETRIES_FOR_LOCK_TX=5
|
||||
|
||||
DB_PATH='./database.sqlite'
|
||||
|
@ -1,12 +1,16 @@
|
||||
import { DataSource } from 'typeorm';
|
||||
import assert from 'assert';
|
||||
|
||||
export async function initializeDataSource() {
|
||||
try {
|
||||
const DB_PATH = process.env.DB_PATH;
|
||||
assert(DB_PATH, 'DB_PATH not set');
|
||||
|
||||
console.log('Initializing Data Source');
|
||||
|
||||
const appDataSource = new DataSource({
|
||||
type: 'sqlite',
|
||||
database: './database.sqlite',
|
||||
database: DB_PATH,
|
||||
synchronize: true,
|
||||
logging: false,
|
||||
entities: [global.entities.Payment, global.entities.Tweet],
|
||||
|
Loading…
Reference in New Issue
Block a user