File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/serverless-offline-sqs/src Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,12 @@ class ServerlessOfflineSQS {
6161
6262 const { sqsEvents, lambdas} = this . _getEvents ( ) ;
6363
64- this . _createLambda ( lambdas ) ;
65-
6664 const eventModules = [ ] ;
6765
66+ if ( lambdas . length > 0 ) {
67+ eventModules . push ( this . _createLambda ( lambdas ) ) ;
68+ }
69+
6870 if ( sqsEvents . length > 0 ) {
6971 eventModules . push ( this . _createSqs ( sqsEvents ) ) ;
7072 }
@@ -119,10 +121,17 @@ class ServerlessOfflineSQS {
119121 }
120122 }
121123
122- _createLambda ( lambdas ) {
124+ async _createLambda ( events , skipStart ) {
125+ if ( ! this . options . host ) {
126+ this . options . host = 'localhost' ;
127+ }
123128 this . lambda = new Lambda ( this . serverless , this . options ) ;
124129
125- this . lambda . create ( lambdas ) ;
130+ await this . lambda . create ( events ) ;
131+
132+ if ( ! skipStart ) {
133+ await this . lambda . start ( ) ;
134+ }
126135 }
127136
128137 async _createSqs ( events , skipStart ) {
You can’t perform that action at this time.
0 commit comments