Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

Commit

Permalink
fix: change private to protected (#49)
Browse files Browse the repository at this point in the history
* fix: change private to protected

* chore: update ioc.json
  • Loading branch information
czy88840616 committed Feb 17, 2020
1 parent 4c48680 commit f5373c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions packages/faas/src/starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,21 @@ export class FaaSStarter implements IFaaSStarter {
) {
return this.lock.sureOnce(async () => {
let containerOptions = {};
try {
if (
existsSync(join(this.appDir, 'ioc.js')) ||
existsSync(join(this.appDir, 'ioc.json'))
) {
const containerOptPath = require.resolve(join(this.appDir, 'ioc'));
this.logger.info(
'midway-faas: ioc config is deprecated,use @Configuration instead.'
);
containerOptions = require(containerOptPath);
if (typeof containerOptions === 'function') {
containerOptions = containerOptions({
baseDir: this.baseDir,
appDir: this.appDir,
} as MidwayFaaSInfo);
}
} catch (err) {
// ignore
this.logger.info('midway-faas: ioc config read fail and skip');
}

this.loader.loadDirectory(Object.assign(opts, containerOptions));
Expand Down
2 changes: 1 addition & 1 deletion packages/serverless-invoke/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export abstract class InvokeCore implements IInvoke {
this.spec = loadSpec(this.baseDir);
}

private async getStarter() {
protected async getStarter() {
if (this.starter) {
return this.starter;
}
Expand Down

0 comments on commit f5373c7

Please sign in to comment.