Commit ad61fb25 authored by marioromera's avatar marioromera
Browse files

fix saveRevision log

parent bacfffe9
......@@ -10,7 +10,7 @@ server {
location / {
proxy_pass https://0.0.0.0:5000;
}
:
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/html;
......
......@@ -33,6 +33,10 @@ module.exports = io => {
(async () => {
const savedRevisions = await saveRevision();
const keywords = await calculatePadTfidf();
logger.rainbow(
'Emitting results',
...keywords.map(kw => kw.term)
);
io.emit('keywords', keywords);
})();
});
......@@ -129,12 +133,14 @@ async function getRevisionText(revision) {
async function saveRevision() {
logger.warn('Saving revision');
const response = await fetch(
`${etherpadUrl}/api/1.2.13/saveRevision?apikey=${etherpadApiKey}&padID=${PAD_ID}`
`${etherpadUrl}/api/1.2.11/saveRevision?apikey=0ee96c0c21cab2c92d817414589f3f4ebf13af96bf54318f4ff72065cca93d27&padID=poc`
);
const etherpadJson = await response.json();
if (!etherpadJson.data) {
logger.error('Revision not saved, error', etherpadJson.data);
if (etherpadJson.messsage !== 'ok') {
logger.error('Revision not saved, error', etherpadJson.message);
} else {
logger.success('Revision saved');
}
return etherpadJson.data;
}
......
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