mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:27:09 +00:00
Refactor list of notification channels into its own file
This commit is contained in:
13
lib/www/server/lib/db/channels.js
Normal file
13
lib/www/server/lib/db/channels.js
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
// This is the list of all channels for which the
|
||||
// database issues notifications.
|
||||
// NOTE: This needs to be kept up to date with
|
||||
// database schema changes.
|
||||
|
||||
module.exports = [
|
||||
"realtime", "event", "project",
|
||||
"preplot_lines", "preplot_points",
|
||||
"planned_lines",
|
||||
"raw_lines", "raw_shots",
|
||||
"final_lines", "final_shots", "info"
|
||||
];
|
||||
@@ -1,17 +1,10 @@
|
||||
const ws = require('ws');
|
||||
const URL = require('url');
|
||||
const db = require('./db');
|
||||
const channels = require('../lib/db/channels');
|
||||
|
||||
function start (server, pingInterval=30000) {
|
||||
|
||||
const channels = [
|
||||
"realtime", "event", "project",
|
||||
"preplot_lines", "preplot_points",
|
||||
"planned_lines",
|
||||
"raw_lines", "raw_shots",
|
||||
"final_lines", "final_shots", "info"
|
||||
];
|
||||
|
||||
const wsServer = new ws.Server({ noServer: true });
|
||||
wsServer.on('connection', socket => {
|
||||
socket.alive = true;
|
||||
|
||||
Reference in New Issue
Block a user