Replies: 1 comment
-
Looks like you haven't added a message queue for these two apps to communicate with each other: https://flask-socketio.readthedocs.io/en/latest/deployment.html#emitting-from-an-external-process. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey Miguel!
I have two Flask apps running on the same machine in separate venv's using supervisord, nginx and gunicorn
The main app handles front-end (port 8000) and works perfectly with socketio.
The other handles bulky/longer running automation scripts. (port 3000) this one I am not seeing emit messages
I want the secondary app/instance to emit process updates to the user...
In an attempt to solve my problem I came across: This past issue. I believe I have it all setup properly, however the secondary app (bgsvc) show's it is emitting but I'm not seeing any of those messages on the front end.... and when emitting a test message from the front, it does not appear to see that message.
NGINX setup:
the /bulk part works as intended (just emit events are not seen by the front end)
SupervisorD config app1:
command=/***/main/bin/gunicorn -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 main:app
app2:
command=/***/bgsvc/bin/gunicorn -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 main:app --bind 0.0.0.0:3000
both apps have same cors_allowed_origins including FQDN and are started like:
I tried starting them with port as 8000 / 3000 (respectively), both on same port, as well as with just:
socketio.run(app)
any of the other ways I start them, the main app sends / recieves all emit events but the bgsvc does not.
Socketio debugging (for bgsvc) shows:
for all events called with:
both virtual environments are running:
Hopefully there is something that I can do to get this working. Otherwise I'm thinking create a route in the main app, that the secondary app makes a request to that will forward the message I want, but figured I'm missing something and you could help point me in the right direction.
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions