Skip to content

Commit

Permalink
chore: adjust desc
Browse files Browse the repository at this point in the history
  • Loading branch information
chakhsu committed Nov 26, 2023
1 parent 266ba67 commit 6713132
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions lib/grpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,20 @@ module.exports = class GrpcLoader {
}

service (name) {
assert(this._types, 'Must called init() first. 尚未加载proto文件到loader.')
assert(this._types, 'Must called init() first. proto file has not been loaded.')
const fullName = this._isDev ? `${this._packagePrefix}.${name}` : name
debug('get service:', fullName)
const service = _.get(this._types, `${fullName}.service`)
assert(service, `Cannot find service with name: ${fullName}, 请检查protos文件是否配置错误,或者漏掉了对应的proto文件`)
assert(service, `Cannot find service with name: ${fullName}, please check if the protos file is configured incorrectly or if the corresponding proto file is missing.`)
return service
}

type (name) {
assert(this._types, 'Must called init() first. 尚未加载proto文件到loader.')
assert(this._types, 'Must called init() first. proto file has not been loaded.')
const fullName = this._isDev ? `${this._packagePrefix}.${name}` : name
debug('get type:', fullName)
const type = _.get(this._types, `${fullName}`)
assert(type, `Cannot find type with name: ${fullName}, 请检查protos文件是否配置错误,或者漏掉了对应的proto文件`)
assert(type, `Cannot find type with name: ${fullName}, please check if the protos file is configured incorrectly or if the corresponding proto file is missing.`)
return type
}

Expand Down Expand Up @@ -240,7 +240,7 @@ module.exports = class GrpcLoader {
}

makeMetadata (initialValues) {
assert(this._types, 'Must called init() first. 尚未加载proto文件到loader.')
assert(this._types, 'Must called init() first. proto file has not been loaded.')
const meta = new grpc.Metadata()
if (typeof initialValues === 'object') {
Object.entries(initialValues).forEach(([key, value]) => {
Expand All @@ -261,7 +261,7 @@ module.exports = class GrpcLoader {
}

initServer (...args) {
assert(this._types, 'Must called init() first. 尚未加载proto文件到loader.')
assert(this._types, 'Must called init() first. proto file has not been loaded.')
return serverProxy._init(this, ...args)
}
}
1 change: 1 addition & 0 deletions lib/proxy/serverProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class ServerProxy {
if (!requestStream && responseStream) {
return this._callServerStreamProxyMethod(target, key, fn)
}
// duplex stream
if (requestStream && responseStream) {
return this._callDuplexStreamProxyMethod(target, key, fn)
}
Expand Down
8 changes: 4 additions & 4 deletions lib/util/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ module.exports = (middleware) => {
}

/**
* @param {Object} context
* @return {Promise}
* @api public
*/
* @param {Object} context
* @return {Promise}
* @api public
*/
return function (context, next) {
// last called middleware #
let index = -1
Expand Down

0 comments on commit 6713132

Please sign in to comment.