Skip to content

Commit

Permalink
refactor(midway-component-kmore): breaking change rename KmoreCompone…
Browse files Browse the repository at this point in the history
…ntConfig['database']

to KmoreComponentConfig['dbConfigs']
  • Loading branch information
waitingsong committed Jun 29, 2021
1 parent 9719bed commit 4d675e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { KmoreComponentConfig } from '../lib/types'

export const kmore: KmoreComponentConfig = {
defaultMaxListeners: 100,
database: {
dbConfigs: {
master: {
autoConnect: true,
config: {},
Expand Down
4 changes: 2 additions & 2 deletions packages/midway-component-kmore/src/lib/db-man.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class DbManager <DbId extends string = any> {
forceConnect = false,
): void {

const { database, defaultMaxListeners } = componentConfig
const { dbConfigs: database, defaultMaxListeners } = componentConfig

EventEmitter.defaultMaxListeners = defaultMaxListeners && defaultMaxListeners >= 0
? defaultMaxListeners
Expand Down Expand Up @@ -72,7 +72,7 @@ export class DbManager <DbId extends string = any> {
logger?: JLogger,
): void {

const { database } = componentConfig
const { dbConfigs: database } = componentConfig

Object.entries(database).forEach(([dbId, row]) => {
this.createOne(dbId as DbId, row, trm, logger)
Expand Down
2 changes: 1 addition & 1 deletion packages/midway-component-kmore/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Span } from 'opentracing'


export interface KmoreComponentConfig <DbId extends string = string> {
database: DbConfigs<DbId>
dbConfigs: DbConfigs<DbId>
/**
* @default 100
* @see https://nodejs.org/dist/latest-v16.x/docs/api/events.html#events_emitter_getmaxlisteners
Expand Down

0 comments on commit 4d675e2

Please sign in to comment.