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 {
61
61
62
62
const { sqsEvents, lambdas} = this . _getEvents ( ) ;
63
63
64
- this . _createLambda ( lambdas ) ;
65
-
66
64
const eventModules = [ ] ;
67
65
66
+ if ( lambdas . length > 0 ) {
67
+ eventModules . push ( this . _createLambda ( lambdas ) ) ;
68
+ }
69
+
68
70
if ( sqsEvents . length > 0 ) {
69
71
eventModules . push ( this . _createSqs ( sqsEvents ) ) ;
70
72
}
@@ -119,10 +121,17 @@ class ServerlessOfflineSQS {
119
121
}
120
122
}
121
123
122
- _createLambda ( lambdas ) {
124
+ async _createLambda ( events , skipStart ) {
125
+ if ( ! this . options . host ) {
126
+ this . options . host = 'localhost' ;
127
+ }
123
128
this . lambda = new Lambda ( this . serverless , this . options ) ;
124
129
125
- this . lambda . create ( lambdas ) ;
130
+ await this . lambda . create ( events ) ;
131
+
132
+ if ( ! skipStart ) {
133
+ await this . lambda . start ( ) ;
134
+ }
126
135
}
127
136
128
137
async _createSqs ( events , skipStart ) {
You can’t perform that action at this time.
0 commit comments