Comments (6)
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.
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.
Yeah, it seems to be related to the MongoDB job store, what version of pymongo
are you using?
from flask-apscheduler.
I just did a test using MongoDB 3.4 and Pymongo 3.5.1, it worked fine.
from flask-apscheduler.
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.
Feel free to reopen it again if you need it.
from flask-apscheduler.
Related Issues (20)
- Running job causes detachedinstanceerror HOT 3
- Use Codecov in informational mode HOT 1
- APScheduler not working with gunicorn eventlet HOT 6
- Flask 2.3.2 causing KeyError: 'JSONIFY_PRETTYPRINT_REGULAR' HOT 1
- Flask-APScheduler multiple jobs running at the same time when having multiple workers HOT 1
- [RFE] Package python3-flask-apscheduler into RPM
- KeyError: 'JSONIFY_PRETTYPRINT_REGULAR' when running Flask as a development server HOT 2
- Apscheduler not working with flask debug=True & --no-reload
- Flask 3.0.0 support HOT 1
- Behaviour of processpool HOT 1
- Key Error while passing redis instance as arg HOT 2
- Can't start BlockingScheduler as daemon in debug mode
- Issue with sqlalchemy (cannot join current thread and working outside of app context) HOT 4
- python3-flask-APScheduler_1.13.0.bb HOT 4
- Can I use hive database to restore jobs? HOT 2
- Coroutine as argument
- use api add task func which is not defined in the app start script failed HOT 2
- alembic migrations
- ModuleNotFoundError: No module named 'flask_apscheduler' HOT 2
- Adding a pyproject.toml to ensure compliance with updates to pip
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-apscheduler.