diff --git a/lib/grpc.js b/lib/grpc.js index 5d6a81a..c7b15ec 100755 --- a/lib/grpc.js +++ b/lib/grpc.js @@ -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 } @@ -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]) => { @@ -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) } } diff --git a/lib/proxy/serverProxy.js b/lib/proxy/serverProxy.js index 1a17837..88944ca 100644 --- a/lib/proxy/serverProxy.js +++ b/lib/proxy/serverProxy.js @@ -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) } diff --git a/lib/util/compose.js b/lib/util/compose.js index 97044fa..b169b99 100644 --- a/lib/util/compose.js +++ b/lib/util/compose.js @@ -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