Serverless-offline: Disable scheduled functions

Created on 4 Nov 2020  路  2Comments  路  Source: dherault/serverless-offline

Please, could you create a option to disable the scheduled functions.

It could be a command line option like

--disableScheduledFunctions

It's is importante because I have some funcions that manipulate data and I don't want to run it every momment on dev time.

Today, I have 2 yml files to control it:

  • one with all my function enabled
  • another with all the scheduled funcions disabled

With this new options, this process could my simpler.

Most helpful comment

We faced the same issue.
As a workaround, we use the IS_OFFLINE env var to interrupt the scheduled functions.

exports.handler = () => {
 if (process.env.IS_OFFLINE) return;
...
}

All 2 comments

We faced the same issue.
As a workaround, we use the IS_OFFLINE env var to interrupt the scheduled functions.

exports.handler = () => {
 if (process.env.IS_OFFLINE) return;
...
}

In order to avoid modifying function source, I'd also appreciate a way to disable scheduled functions from running for serverless-offline.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rafaelsk picture Rafaelsk  路  4Comments

ghost picture ghost  路  4Comments

stonebraker picture stonebraker  路  3Comments

adambiggs picture adambiggs  路  4Comments

Dong9769 picture Dong9769  路  4Comments