Replace ad-hoc notifier with pg-listen based version

This commit is contained in:
D. Berge
2023-09-29 15:44:12 +02:00
parent 998c272bf8
commit ee0c0e7308
2 changed files with 3 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
const { listen } = require('../ws/db');
const { listen } = require('../lib/db/notify');
const channels = require('../lib/db/channels');
const handlers = require('./handlers').init();
const { ERROR, INFO, DEBUG } = require('DOUGAL_ROOT/debug')(__filename);

View File

@@ -1,6 +1,6 @@
const ws = require('ws');
const URL = require('url');
const db = require('./db');
const { listen } = require('../lib/db/notify');
const channels = require('../lib/db/channels');
function start (server, pingInterval=30000) {
@@ -22,7 +22,7 @@ function start (server, pingInterval=30000) {
}
});
db.listen(channels, (data) => {
listen(channels, (data) => {
wsServer.clients.forEach( (socket) => {
socket.send(JSON.stringify(data));
})