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