Code Monkey home page Code Monkey logo

Comments (6)

eandre avatar eandre commented on May 18, 2024 2

Adding that support would make the configuration much more complex. I think your idea of supporting querying the environment at runtime is a reasonable one and something we need for other use cases as well!

from encore.

pbrazdil avatar pbrazdil commented on May 18, 2024

I agree with taking Kubernetes CronJob design approach, it looks straightforward and what I would expect without any supripses. I like the config approach as well.

I am not a fan of endpoints without params only limitation. Sometimes it would be very helpful to be able to have params available for use. If it's unreasonably time expensive to implement I will be able to live without it, no problem with that.

from encore.

eandre avatar eandre commented on May 18, 2024

Thanks @pbrazdil for the feedback! What use cases are you thinking of for passing parameters? Could you define a parameter-less endpoint for use with cron that calls another endpoint with parameters?

from encore.

melkstam avatar melkstam commented on May 18, 2024

What do you think about the posibility to run cron jobs for individual environments? We have a use case where we have an environment for demo purposes (a production environment) which we regularly want to add new data to.

Is there otherwise any way to dynamically in the endpoint retreive what environment we are running in, e.g. via some environment variable? In that case we could guard when to run the code.

from encore.

Willyham avatar Willyham commented on May 18, 2024

Seems like a good pragmatic approach for the short/mid term to me. Long term, I think it would be nice to consider the possibility of a "task/job queue" approach to this, which might let us specify some of the retry semantics, and open up the possibility of a more powerful API for programatic tasks (e.g. I want to spawn some job every hour after somebody signs up in my app for the first 8 hours). We'd also then get sub-minute resolution (I'm currently building a system outside of encore which requires this).

There are some existing projects you could take inspiration from like. https://github.com/RichardKnop/machinery

from encore.

eandre avatar eandre commented on May 18, 2024

This is now live in v0.19.0! 🎉

from encore.

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.