Имя коллекции получается из конфига
This commit is contained in:
parent
de05a86f59
commit
5d4fd808f3
1 changed files with 4 additions and 1 deletions
|
|
@ -1,6 +1,9 @@
|
||||||
import { CouchDb } from '@app/event-emitter/couchdb-datasources/couchdb';
|
import { CouchDb } from '@app/event-emitter/couchdb-datasources/couchdb';
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import nano from 'nano';
|
import nano from 'nano';
|
||||||
|
import configuration from '../configs/app';
|
||||||
|
|
||||||
|
const config = configuration();
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Changes {
|
export class Changes {
|
||||||
|
|
@ -16,7 +19,7 @@ export class Changes {
|
||||||
}
|
}
|
||||||
Changes.initilized = true;
|
Changes.initilized = true;
|
||||||
const n = CouchDb.getCouchDb();
|
const n = CouchDb.getCouchDb();
|
||||||
const changesDbName = ''; // TODO: Загрузить из конфига
|
const changesDbName = config.couchDb.dbs.changes;
|
||||||
const dbs = await n.db.list();
|
const dbs = await n.db.list();
|
||||||
if (!dbs.includes(changesDbName)) {
|
if (!dbs.includes(changesDbName)) {
|
||||||
await n.db.create(changesDbName);
|
await n.db.create(changesDbName);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue