Commit 2c309ac6 authored by marioromera's avatar marioromera
Browse files

correct connected etherpad message

parent 1df2ddd2
......@@ -24,7 +24,9 @@ publisher.on('error', e => {
});
publisher.on('connect', () => {
publisher.publish('etherpad-ready');
console.log('Redis connection succesfull');
publisher.publish('pad:' + this.id, 'etherpad-connected');
});
// serialization/deserialization attributes
......
......@@ -5,7 +5,7 @@ SERVER_PORT=5000
ETHERPAD_PORT=9001
RPI_ETHERPAD_URL=localhost
DEV_ETHERPAD_URL=35.204.109.110
ETHERPAD_RPI_API_KEY=0ee96c0c21cab2c92d817414589f3f4ebf13af96bf54318f4ff72065cca93d27
ETHERPAD_RPI_API_KEY=45a3ad5f451b8c0d179f940187f0e22656002c9c7bebc79cc2af75df964c56e7
ETHERPAD_DEV_API_KEY=45a3ad5f451b8c0d179f940187f0e22656002c9c7bebc79cc2af75df964c56e7
ETHERPAD_PRODUCTION_API_KEY=45a3ad5f451b8c0d179f940187f0e22656002c9c7bebc79cc2af75df964c56e7
REDIS_PORT=6379
......
......@@ -28,12 +28,14 @@ module.exports = io => {
subscriber.on('connect', () => {
logger.success('Redis connected');
subscriber.subscribe(`pad:${PAD_ID}`);
subscriber.on('etherpad-ready', () => {
startEtherpad();
});
subscriber.on('message', (channel, message) => {
logger.warn('Pad updated', message);
(async () => {
if (
message && message === 'etherpad-connected'
) {
return startEtherpad();
}
const savedRevisions = await saveRevision();
const keywords = await calculatePadTfidf();
logger.rainbow(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment