Skip to content

Commit

Permalink
Fix --useSeparateProcesses
Browse files Browse the repository at this point in the history
  • Loading branch information
godu committed Apr 27, 2019
1 parent 71cb00a commit 7a10ad6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
11 changes: 8 additions & 3 deletions packages/serverless-offline-dynamodb-streams/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const {
pipe,
startsWith
} = require('lodash/fp');
const {createHandler, getFunctionOptions} = require('serverless-offline/src/functionHelper');
const functionHelper = require('serverless-offline/src/functionHelper');
const createLambdaContext = require('serverless-offline/src/createLambdaContext');
const DynamoDBReadable = require('dynamodb-streams-readable');

Expand Down Expand Up @@ -96,8 +96,13 @@ class ServerlessOfflineDynamoDBStreams {

const serviceRuntime = this.service.provider.runtime;
const servicePath = join(this.serverless.config.servicePath, location);
const funOptions = getFunctionOptions(__function, functionName, servicePath, serviceRuntime);
const handler = createHandler(funOptions, this.config);
const funOptions = functionHelper.getFunctionOptions(
__function,
functionName,
servicePath,
serviceRuntime
);
const handler = functionHelper.createHandler(funOptions, this.config);

const lambdaContext = createLambdaContext(__function, (err, data) => {
this.serverless.cli.log(
Expand Down
11 changes: 8 additions & 3 deletions packages/serverless-offline-kinesis/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const {
pipe,
startsWith
} = require('lodash/fp');
const {createHandler, getFunctionOptions} = require('serverless-offline/src/functionHelper');
const functionHelper = require('serverless-offline/src/functionHelper');
const createLambdaContext = require('serverless-offline/src/createLambdaContext');

const fromCallback = fun =>
Expand Down Expand Up @@ -86,8 +86,13 @@ class ServerlessOfflineKinesis {

const serviceRuntime = this.service.provider.runtime;
const servicePath = join(this.serverless.config.servicePath, location);
const funOptions = getFunctionOptions(__function, functionName, servicePath, serviceRuntime);
const handler = createHandler(funOptions, this.config);
const funOptions = functionHelper.getFunctionOptions(
__function,
functionName,
servicePath,
serviceRuntime
);
const handler = functionHelper.createHandler(funOptions, this.config);
const lambdaContext = createLambdaContext(__function, (err, data) => {
this.serverless.cli.log(
`[${err ? figures.cross : figures.tick}] ${JSON.stringify(data) || ''}`
Expand Down
11 changes: 8 additions & 3 deletions packages/serverless-offline-sqs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const {
omitBy,
pipe
} = require('lodash/fp');
const {createHandler, getFunctionOptions} = require('serverless-offline/src/functionHelper');
const functionHelper = require('serverless-offline/src/functionHelper');
const createLambdaContext = require('serverless-offline/src/createLambdaContext');

const fromCallback = fun =>
Expand Down Expand Up @@ -109,8 +109,13 @@ class ServerlessOfflineSQS {
const serviceRuntime = this.service.provider.runtime;
const servicePath = join(this.serverless.config.servicePath, location);

const funOptions = getFunctionOptions(__function, functionName, servicePath, serviceRuntime);
const handler = createHandler(funOptions, this.config);
const funOptions = functionHelper.getFunctionOptions(
__function,
functionName,
servicePath,
serviceRuntime
);
const handler = functionHelper.createHandler(funOptions, this.config);

const lambdaContext = createLambdaContext(__function, (err, data) => {
this.serverless.cli.log(
Expand Down

0 comments on commit 7a10ad6

Please sign in to comment.