Giter Site home page Giter Site logo

Comments (9)

vangorra avatar vangorra commented on May 28, 2024 5

There is a serverless plugin for this now:
https://github.com/ajmath/serverless-offline-scheduler

from serverless-offline.

dherault avatar dherault commented on May 28, 2024

I don't know what are scheduled events yet. Is it like a cron call on your lambda?

from serverless-offline.

andreipopovici avatar andreipopovici commented on May 28, 2024

@dherault, yup, they're created via CloudFormation in serverless. They're actually "Events" in CloudWatch, exactly like cron calls. As far as I can tell, they need to be enabled manually the first time they're deployed with serverless.

@vanerleo, I think enabling events would be tricky for serverless-offline and might be better suited for a separate plugin. It would involve keeping track of event trigger times and the current time/date, which seems something system-wide and beyond the scope of a stateless HTTP server.

However, a convenient way to load the entire serverless-offline environment and manually run a function would be nice. Something like sls offline run functionName?

from serverless-offline.

vanerleo avatar vanerleo commented on May 28, 2024

agreed ,sls offline run functionName would be a good feature to set up all vars at least

@andreipopovici in regards to enabling them in CouldWatch, i've read that having a setting in "config"
{
"enabled": true
}

should enable it ... but so far no luck with getting it to auto enable on first deploy
see serverless/serverless#698
serverless/serverless#939

from serverless-offline.

andreipopovici avatar andreipopovici commented on May 28, 2024

@vanerleo I had no idea about the enabled flag! Thanks for that 👍

With [email protected] and higher, I think that the default sls function run functionName actually loads all env variables specified in the _meta folder for that particular stage, so that's a possible existing replacement.

@vanerleo, I would see the ability to run scheduled events as part of a fork of serverless-offline, made with the purpose of replacing AWS Lambda itself with a self-hosted solution (to help escape vendor lock-in). Till then, I recommend closing this issue, if you and @dherault agree.

from serverless-offline.

vanerleo avatar vanerleo commented on May 28, 2024

@vangorra nice one, thanks

from serverless-offline.

NihalAhmedBismillah avatar NihalAhmedBismillah commented on May 28, 2024

Thanks @vanerleo its working after added plugin. 👍

from serverless-offline.

terreb avatar terreb commented on May 28, 2024

@vangorra, it works with nodejs functions only

from serverless-offline.

offloda avatar offloda commented on May 28, 2024

TY @vangorra, it's work for me. i tried for the other plugin serverless-offline-schedule but the plugin have a bug when try to run.

from serverless-offline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.