refactor!: Frappe handlers using same extensible socketio
This commit is contained in:
parent
a313fb90cb
commit
4778090024
2 changed files with 2 additions and 6 deletions
|
|
@ -1,10 +1,10 @@
|
||||||
const { frappe_request } = require("../utils");
|
const { frappe_request } = require("./utils");
|
||||||
const log = console.log;
|
const log = console.log;
|
||||||
|
|
||||||
const WEBSITE_ROOM = "website";
|
const WEBSITE_ROOM = "website";
|
||||||
const SITE_ROOM = "all";
|
const SITE_ROOM = "all";
|
||||||
|
|
||||||
function frappe_handlers(realtime, socket) {
|
function frappe_handlers(socket) {
|
||||||
socket.join(user_room(socket.user));
|
socket.join(user_room(socket.user));
|
||||||
socket.join(WEBSITE_ROOM);
|
socket.join(WEBSITE_ROOM);
|
||||||
|
|
||||||
|
|
@ -27,11 +27,7 @@ const authenticate = require("./middlewares/authenticate");
|
||||||
realtime.use(authenticate);
|
realtime.use(authenticate);
|
||||||
// =======================
|
// =======================
|
||||||
|
|
||||||
// load and register handlers
|
|
||||||
const frappe_handlers = require("./handlers/frappe_handlers");
|
|
||||||
function on_connection(socket) {
|
function on_connection(socket) {
|
||||||
frappe_handlers(realtime, socket);
|
|
||||||
|
|
||||||
socket.installed_apps.forEach((app) => {
|
socket.installed_apps.forEach((app) => {
|
||||||
let app_handler = get_app_handlers(app);
|
let app_handler = get_app_handlers(app);
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue