Giter Club home page Giter Club logo

Comments (7)

viniciuschiele avatar viniciuschiele commented on July 18, 2024

Hi

My APScheduler object does not expose the methods pause and resume, I will add them later on.

As a workaround you can get the original APScheduler object doing that:

@app.route("/patchAPI/<PIN>", methods=['GET'])
    def patchThem():
        scheduler.scheduler.pause() # .scheduler gets the original APScheduler object
        resp=classic.patchPINCollection()
        return(resp)

from flask-apscheduler.

viniciuschiele avatar viniciuschiele commented on July 18, 2024

Hi,
I've just released a new version that includes the methods pause and resume.

Now your previous code should work just fine.

from flask-apscheduler.

mrabhiram avatar mrabhiram commented on July 18, 2024

Hi,
Thank you. It worked perfectly fine. Just wanted to clarify something to get it right.
-> When we pause the scheduler, all the current working jobs complete their scheduled jobs and then pause. Is that correct?
-> Is there a way to execute jobs synchronously? One after the other? One job completes, notifies the next job in loop? Is there a way around that? I tried but couldn't figure out a way to do that.

Best

from flask-apscheduler.

viniciuschiele avatar viniciuschiele commented on July 18, 2024

When we pause the scheduler, all the current working jobs complete their scheduled jobs and then pause. Is that correct?

Yes, that is correct.

Is there a way to execute jobs synchronously? One after the other? One job completes, notifies the next job in loop? Is there a way around that? I tried but couldn't figure out a way to do that.

If you need it synchronously why don't you just call the other job as a normal Python function?
Anyway, it is not possible to trigger another job within a job, such thing is only possible using Celery which fits better complex job requirements.

from flask-apscheduler.

mrabhiram avatar mrabhiram commented on July 18, 2024

Thank you, for your info.
I am also trying to pause a particular job using job id. In the documentation it is said that we can do it by using job id. I am not able to get it.

apscheduler.job_id.Job.pause()

Is this the way?

The code I used to config jobs is above, the same. Could you tell me how to pause only one particular job?

from flask-apscheduler.

viniciuschiele avatar viniciuschiele commented on July 18, 2024

I have to use pause_job:

apscheduler.pause_job('job id')

from flask-apscheduler.

mrabhiram avatar mrabhiram commented on July 18, 2024

Thank you. I was also able to do the above by getting jobs using get_jobs and then selecting the particular job id.

from flask-apscheduler.

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.