ajmath / serverless-offline-scheduler

MIT License
96 stars 40 forks source link

Hung on first run #57

Closed Daniel-Yonkov closed 3 years ago

Daniel-Yonkov commented 4 years ago

Hey there, after either running

serverless offline starat

or

serverless offline start --runSchedulesOnInit

The serverless offline hungs and upon force exit it returns an error:

Command failed: /usr/bin/node /.../node_modules/.bin/serverless invoke local 
--function cron_ocr_process_pending_submission
--data {"account":"********","region":"serverless-offline","detail":{},"detail-type":"Scheduled 
Event","source":"aws.events","time":"2020-10-28T12:17:08.617Z","id":"some-id","resources":["arn:aws:events:serverless-
offline:1********:rule/cron_ocr_process_pending_submission"],"isOffline":true}

Any idea how to fix this or what is the issue behind it?


Details:

Serverless offline version: ^3.33.0 serverless-offline-scheduler": ^0.4.2

serverless.yml plugins:

plugins:
  - serverless-offline-scheduler
  - serverless-plugin-split-stacks
  - serverless-plugin-browserify
  - serverless-offline
  - serverless-domain-manager
  - serverless-plugin-custom-roles
Daniel-Yonkov commented 3 years ago

Issue is related to MongoDB connection not closing after scheduled job terminates.

Closing the connection resolved the issue