Giter Club home page Giter Club logo

Comments (6)

viniciuschiele avatar viniciuschiele commented on July 19, 2024

Hi @beshe,

Are you using a persisted job store (like SQLALchemy, MongoDB) or the default one (in memory)?

I'm asking it because the delete_all_jobs with in memory job store doesn't call any _remove().

Can you see the stack trace for this error?

from flask-apscheduler.

beshe avatar beshe commented on July 19, 2024

yes, I'm using the MongoDB as the jobstore. And it works after I tried to switch to use memory as jobstore. So is it the caused by the mongodb job store?

    SCHEDULER_JOBSTORES = {
        'default': MongoDBJobStore(host='localhost', port=27017)
    }
    SCHEDULER_API_ENABLE = True
    SCHEDULER_JOB_DEFAULTS = {
        'coalesce': False,
        'max_instances': 3
    }

below is the trace log.

Traceback (most recent call last)
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\flask\app.py", line 1997, in __call__
return self.wsgi_app(environ, start_response)
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\flask\app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\flask\app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\flask\app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\flask_debugtoolbar\__init__.py", line 125, in dispatch_request
return view_func(**req.view_args)
File "D:\workspace\FlaskProject\flask_study\StockProject\app\schedule\views.py", line 121, in deleteall
scheduler.delete_all_jobs()
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\flask_apscheduler\scheduler.py", line 164, in delete_all_jobs
self._scheduler.remove_all_jobs(jobstore)
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\apscheduler\schedulers\base.py", line 638, in remove_all_jobs
store.remove_all_jobs()
File "D:\workspace\Python\VirtualEnvs\stock\lib\site-packages\apscheduler\jobstores\mongodb.py", line 109, in remove_all_jobs
self.collection.remove()
TypeError: _remove() takes at least 2 arguments (1 given)

from flask-apscheduler.

viniciuschiele avatar viniciuschiele commented on July 19, 2024

Yeah, it seems to be related to the MongoDB job store, what version of pymongo are you using?

from flask-apscheduler.

viniciuschiele avatar viniciuschiele commented on July 19, 2024

I just did a test using MongoDB 3.4 and Pymongo 3.5.1, it worked fine.

from flask-apscheduler.

beshe avatar beshe commented on July 19, 2024

here is the version in my local environment. Strange, I've tried python2.7.12 and python3.6, both not work, I need to do further research.

MongoDB version is v3.4.2

APScheduler==3.3.1
Flask==0.12.2
Flask-APScheduler==1.7.0
mongoengine==0.13.0
pymongo==3.5.0

from flask-apscheduler.

viniciuschiele avatar viniciuschiele commented on July 19, 2024

Feel free to reopen it again if you need it.

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.