-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flask main thread is hang ,not handler request #41
Comments
what does your Flask endpoint do? APScheduler runs on its own thread, I don't see how it could happen. |
ps H -C python -o 'pid tid cmd' sudo strace -p 26664 26665 and 26666 same sa 26664 |
sudo strace -p 26657 |
Are you sure the issue is not in the Flask endpoint? Can you post entire code? |
Feel free to open this issue again. |
#scheduler.py
JOBS = [ { 'id': 'just test', 'func': '__builtin__:print', 'args': ('test .......',), 'trigger': 'interval', 'seconds': 5, } ]
#runserver.py
from flask import Flask
from flask_apscheduler import APScheduler
app = Flask('myapp')
app.config.from_pyfile('./scheduler.py')
apscheduler = APScheduler(app=app)
apscheduler.start()
app.run()
##thread info
###:~$ sudo ps H -C python -o 'pid tid cmd'
PID TID CMD
19690 19690 python runserver.py
19690 19699 python runserver.py
19690 19700 python runserver.py
19690 19701 python runserver.py
the apscheduler can execute, but flask can not handler http request
port 5000 open and listening, when i curl localhost:5000 , it will block forever.
The text was updated successfully, but these errors were encountered: