Commit graph

10 commits

Author SHA1 Message Date
Ankush Menat
b5409f6f07 chore: remove eslint-disable* 2023-07-14 15:41:20 +05:30
David Arnold
98d38e7333
fix: gently log the port on which the realtime service listens (#21575)
* fix: gently log the port on which the realtime service listens

without this, the service remains completely silent (e.g. in overmind) and it is hard to tell if it is even running

* Revert "fix: gently log the port on which the realtime service listens"

This reverts commit 14a21989c6767520d8e1b9d46cc9f58a45768563.

* refactor(socketio): explicitly listen on port

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-07-14 11:36:31 +05:30
Ankush Menat
be8d2b9de0 perf: lazy websocket connection on website
Establishing 1 connection for every website visit is too much.

Only after calling frappe.realtime.on(...) for ANY event, we will
establish a websocket connection.

This is used for handful of things:
- Discussion component
- File upload

Socketio was initially added here: https://github.com/frappe/frappe/pull/6866 this use case no longer exists.

Rarely anywhere website uses realtime.
2023-07-01 12:43:53 +05:30
Ankush Menat
bdaed29ef2 refactor: move handlers to separate file 2023-07-01 12:43:47 +05:30
Ankush Menat
d59e499418 refactor!: Use SocketIO namespaces for multitenancy 2023-07-01 10:53:34 +05:30
Ankush Menat
dad1d57b90 chore: move redis sub setup 2023-07-01 10:53:34 +05:30
Ankush Menat
d13cb116bc refactor: use existing redis client 2023-07-01 10:53:34 +05:30
Ankush Menat
7320d2d020 refactor: move middleware out 2023-07-01 10:53:34 +05:30
Ankush Menat
164840c32e refactor: explicitly import socketio 2023-07-01 10:53:34 +05:30
Ankush Menat
5e4e60b509 refactor: Split socketio in multiple logical files 2023-07-01 10:53:34 +05:30